diff options
author | alepulver <alepulver@FreeBSD.org> | 2006-10-06 10:32:32 +0800 |
---|---|---|
committer | alepulver <alepulver@FreeBSD.org> | 2006-10-06 10:32:32 +0800 |
commit | 37226fc26042398541f1ab44e43cd15d62e3753b (patch) | |
tree | aa27bfb3f73ebe70c0ff09bea374db1f52ed9d56 /sysutils/torque/files | |
parent | 20b0815335f2255bb09fde5dbb4ad4c29a42ba0d (diff) | |
download | freebsd-ports-gnome-37226fc26042398541f1ab44e43cd15d62e3753b.tar.gz freebsd-ports-gnome-37226fc26042398541f1ab44e43cd15d62e3753b.tar.zst freebsd-ports-gnome-37226fc26042398541f1ab44e43cd15d62e3753b.zip |
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.
WWW: http://www.clusterresources.com/pages/products/torque-resource-manager.php
PR: ports/103296
Submitted by: trasz
Diffstat (limited to 'sysutils/torque/files')
-rw-r--r-- | sysutils/torque/files/patch-fifo-Makefile.in | 11 | ||||
-rw-r--r-- | sysutils/torque/files/patch-mom_mach.c | 361 | ||||
-rw-r--r-- | sysutils/torque/files/patch-pbs_mkdirs.in | 19 | ||||
-rw-r--r-- | sysutils/torque/files/pbs_mom.sh.in | 27 | ||||
-rw-r--r-- | sysutils/torque/files/pbs_sched.sh.in | 27 | ||||
-rw-r--r-- | sysutils/torque/files/pbs_server.sh.in | 27 | ||||
-rw-r--r-- | sysutils/torque/files/pkg-message.in | 40 |
7 files changed, 512 insertions, 0 deletions
diff --git a/sysutils/torque/files/patch-fifo-Makefile.in b/sysutils/torque/files/patch-fifo-Makefile.in new file mode 100644 index 000000000000..3a196cb805f9 --- /dev/null +++ b/sysutils/torque/files/patch-fifo-Makefile.in @@ -0,0 +1,11 @@ +--- src.orig/scheduler.cc/samples/fifo/Makefile.in Wed Jul 19 22:47:42 2006 ++++ src/scheduler.cc/samples/fifo/Makefile.in Wed Jul 19 22:59:44 2006 +@@ -132,7 +132,7 @@ + XPBSMON_DIR = $(libdir)/xpbsmon + + # Support files used by the scheduler +-schedprivdir = $(PBS_SERVER_HOME)/sched_priv ++schedprivdir = ${prefix}/share/examples/torque/var/spool/torque/sched_priv + schedpriv_DATA = sched_config resource_group holidays dedicated_time + + EXTRA_DIST = $(schedpriv_DATA) diff --git a/sysutils/torque/files/patch-mom_mach.c b/sysutils/torque/files/patch-mom_mach.c new file mode 100644 index 000000000000..ff94b2bdb9c3 --- /dev/null +++ b/sysutils/torque/files/patch-mom_mach.c @@ -0,0 +1,361 @@ +--- src/resmom/freebsd/mom_mach.c.orig Tue Jun 20 02:23:04 2006 ++++ src/resmom/freebsd/mom_mach.c Thu Sep 14 19:09:58 2006 +@@ -370,40 +370,10 @@ + 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); +- } ++ cputime += pp->ki_runtime / 1000000; + DBPRT(("%s: ses %d pid %d cputime %d\n", id, +- sess_tbl[i], pp->kp_proc.p_pid, cputime)) ++ sess_tbl[i], pp->ki_pid, pp->ki_runtime / 1000000)) + } + + if (nps == 0) +@@ -434,11 +404,9 @@ + 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); ++ memsize += pp->ki_size; + DBPRT(("%s: ses %d pid=%d totmem=%lu\n", id, +- sess_tbl[i], pp->kp_proc.p_pid, memsize)) ++ sess_tbl[i], pp->ki_pid, pp->ki_size)) + } + + return (memsize); +@@ -461,10 +429,10 @@ + if (!injob(pjob, sess_tbl[i])) + continue; + +- memsize += ctob(pp->kp_eproc.e_vm.vm_rssize); ++ memsize += pp->ki_rssize * PAGE_SIZE; + 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)) ++ pp->ki_pid, sess_tbl[i], ++ pp->ki_rssize * PAGE_SIZE, memsize)) + } + + return (memsize); +@@ -485,9 +453,7 @@ + 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) ++ if (pp->ki_size > limit) + return (TRUE); + } + +@@ -732,7 +698,7 @@ + const void *b) + + { +- return((int)((struct kinfo_proc *)a)->kp_eproc.e_paddr - (int)((struct kinfo_proc *)b)->kp_eproc.e_paddr); ++ return((int)((struct kinfo_proc *)a)->ki_paddr - (int)((struct kinfo_proc *)b)->ki_paddr); + } + + int bs_cmp( +@@ -741,7 +707,7 @@ + const void *member) + + { +- return((int)((struct session *)key)->s_leader - (int)((struct kinfo_proc *)member)->kp_eproc.e_paddr); ++ return((int)((struct session *)key)->s_leader - (int)((struct kinfo_proc *)member)->ki_paddr); + } + + +@@ -786,24 +752,10 @@ + + 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; ++ for (i=0; i<nproc; i++) { ++ struct kinfo_proc *pp = &proc_tbl[i]; ++ ++ sess_tbl[i] = pp->ki_sid; + } + + return (PBSE_NONE); +@@ -1012,8 +964,8 @@ + 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); ++ sig, pp->ki_pid)) ++ (void)kill(pp->ki_pid, sig); + ++ct; + } + return ct; +@@ -1118,36 +1070,10 @@ + 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; ++ cputime += pp->ki_runtime / 1000000; + +- 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)) ++ jobid, pp->ki_pid, cputime)) + + } + +@@ -1166,37 +1092,11 @@ + for (i=0; i<nproc; i++) { + struct kinfo_proc *pp = &proc_tbl[i]; + +- if (pid != pp->kp_proc.p_pid) ++ if (pid != pp->ki_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; ++ cputime = pp->ki_runtime / 1000000; + +- 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); +@@ -1261,13 +1161,11 @@ + 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; ++ addmem = pp->ki_size; + memsize += addmem; + } + if (found) { +- sprintf(ret_string, "%ukb", ctob(memsize) >> 10); /* KB */ ++ sprintf(ret_string, "%ukb", memsize / 1024); /* KB */ + return ret_string; + } + +@@ -1289,13 +1187,11 @@ + for (i=0; i<nproc; i++) { + struct kinfo_proc *pp = &proc_tbl[i]; + +- if (pid != pp->kp_proc.p_pid) ++ if (pid != pp->ki_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 */ ++ memsize = pp->ki_size; ++ sprintf(ret_string, "%ukb", memsize / 1024); /* KB */ + return ret_string; + } + +@@ -1358,10 +1254,10 @@ + continue; + + found = 1; +- resisize += pp->kp_eproc.e_vm.vm_rssize; ++ resisize += pp->ki_rssize * PAGE_SIZE; + } + if (found) { +- sprintf(ret_string, "%ukb", ctob(resisize) >> 10); /* KB */ ++ sprintf(ret_string, "%ukb", resisize / 1024); /* KB */ + return ret_string; + } + +@@ -1385,11 +1281,11 @@ + for (i=0; i<nproc; i++) { + struct kinfo_proc *pp = &proc_tbl[i]; + +- if (pid != pp->kp_proc.p_pid) ++ if (pid != pp->ki_pid) + continue; + +- resisize = pp->kp_eproc.e_vm.vm_rssize; +- sprintf(ret_string, "%ukb", ctob(resisize) >> 10); /* KB */ ++ resisize = pp->ki_rssize * PAGE_SIZE; ++ sprintf(ret_string, "%ukb", resisize / 1024); /* KB */ + return ret_string; + } + +@@ -1462,12 +1358,12 @@ + for (i=0; i<nproc; i++) { + struct kinfo_proc *pp = &proc_tbl[i]; + +- if (pp->kp_eproc.e_pcred.p_ruid == 0) ++ if (pp->ki_ruid == 0) + continue; + + jobid = sess_tbl[i]; + DBPRT(("%s: pid %d sid %u\n", +- id, (int)pp->kp_proc.p_pid, jobid)) ++ id, (int)pp->ki_pid, jobid)) + for (j=0; j<njids; j++) { + if (jids[j] == jobid) + break; +@@ -1548,12 +1444,12 @@ + 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])) ++ id, num_pids, pp->ki_pid, sess_tbl[i])) + if (jobid != sess_tbl[i]) + continue; + + checkret(&fmt, 100); +- sprintf(fmt, " %d", pp->kp_proc.p_pid); ++ sprintf(fmt, " %d", pp->ki_pid); + fmt += strlen(fmt); + num_pids++; + } +@@ -1591,11 +1487,11 @@ + for (i=0; i<nproc; i++) { + struct kinfo_proc *pp = &proc_tbl[i]; + +- if ((uid = pp->kp_eproc.e_pcred.p_ruid) == 0) ++ if ((uid = pp->ki_ruid) == 0) + continue; + + DBPRT(("%s: pid %d uid %u\n", +- id, (int)pp->kp_proc.p_pid, uid)) ++ id, (int)pp->ki_pid, uid)) + for (j=0; j<nuids; j++) { + if (uids[j] == uid) + break; +@@ -1884,23 +1780,12 @@ + continue; + } + else { +- if (value != pp->kp_proc.p_pid) ++ if (value != pp->ki_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); ++ start = MIN(start, pp->ki_start.tv_sec); + } + if (found) { + sprintf(ret_string, "%ld", (long)((double)(now - start) * wallfactor)); +@@ -2035,7 +1920,7 @@ + dirdev = sb.st_dev; + DBPRT(("dir has devnum %d\n", dirdev)) + +- if (setfsent() == NULL) { ++ if (setfsent() == 0) { + log_err(errno, id, "setfsent"); + rm_errno = RM_ERR_SYSTEM; + return NULL; diff --git a/sysutils/torque/files/patch-pbs_mkdirs.in b/sysutils/torque/files/patch-pbs_mkdirs.in new file mode 100644 index 000000000000..732193534b50 --- /dev/null +++ b/sysutils/torque/files/patch-pbs_mkdirs.in @@ -0,0 +1,19 @@ +--- buildutils/dpbs_mkdirs.in.orig Tue Jun 20 02:22:46 2006 ++++ buildutils/pbs_mkdirs.in Thu Sep 14 15:06:48 2006 +@@ -105,6 +105,7 @@ + # + prefix=@prefix@ + exec_prefix=@exec_prefix@ ++DESTDIR=@prefix@ + CHK_TREE=${DESTDIR}@bindir@/chk_tree + + PBS_DEFAULT_SERVER=@PBS_DEFAULT_SERVER@ +@@ -112,7 +113,7 @@ + # 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_SERVER_HOME" || PBS_SERVER_HOME=/share/examples/torque/var/spool/torque/ + test -n "$PBS_DEFAULT_FILE" || PBS_DEFAULT_FILE=${DESTDIR}@PBS_DEFAULT_FILE@ + test -n "$PBS_ENVIRON" || PBS_ENVIRON=${DESTDIR}@PBS_ENVIRON@ + diff --git a/sysutils/torque/files/pbs_mom.sh.in b/sysutils/torque/files/pbs_mom.sh.in new file mode 100644 index 000000000000..60cde8368343 --- /dev/null +++ b/sysutils/torque/files/pbs_mom.sh.in @@ -0,0 +1,27 @@ +#!/bin/sh + +# PROVIDE: pbs_mom +# REQUIRE: +# +# Add the following lines to /etc/rc.conf.local or /etc/rc.conf +# to enable this service: +# +# pbs_mom_enable (bool): Set to NO by default. +# Set it to YES to enable pbs_mom. +# + +. %%RC_SUBR%% + +name="pbs_mom" +rcvar=${name}_enable + +pidfile=/var/spool/torque/mom_priv/mom.lock +command=%%PREFIX%%/sbin/${name} + +load_rc_config $name + +: ${pbs_mom_enable="NO"} + +command_args="" + +run_rc_command "$1" diff --git a/sysutils/torque/files/pbs_sched.sh.in b/sysutils/torque/files/pbs_sched.sh.in new file mode 100644 index 000000000000..885be18bf945 --- /dev/null +++ b/sysutils/torque/files/pbs_sched.sh.in @@ -0,0 +1,27 @@ +#!/bin/sh + +# PROVIDE: pbs_sched +# REQUIRE: pbs_server +# +# Add the following lines to /etc/rc.conf.local or /etc/rc.conf +# to enable this service: +# +# pbs_sched_enable (bool): Set to NO by default. +# Set it to YES to enable pbs_sched. +# + +. %%RC_SUBR%% + +name="pbs_sched" +rcvar=${name}_enable + +pidfile=/var/spool/torque/sched_priv/sched.lock +command=%%PREFIX%%/sbin/${name} + +load_rc_config $name + +: ${pbs_sched_enable="NO"} + +command_args="" + +run_rc_command "$1" diff --git a/sysutils/torque/files/pbs_server.sh.in b/sysutils/torque/files/pbs_server.sh.in new file mode 100644 index 000000000000..e19696a349fe --- /dev/null +++ b/sysutils/torque/files/pbs_server.sh.in @@ -0,0 +1,27 @@ +#!/bin/sh + +# PROVIDE: pbs_server +# REQUIRE: +# +# Add the following lines to /etc/rc.conf.local or /etc/rc.conf +# to enable this service: +# +# pbs_server_enable (bool): Set to NO by default. +# Set it to YES to enable pbs_server. +# + +. %%RC_SUBR%% + +name="pbs_server" +rcvar=${name}_enable + +pidfile=/var/spool/torque/server_priv/server.lock +command=%%PREFIX%%/sbin/${name} + +load_rc_config $name + +: ${pbs_server_enable="NO"} + +command_args="" + +run_rc_command "$1" diff --git a/sysutils/torque/files/pkg-message.in b/sysutils/torque/files/pkg-message.in new file mode 100644 index 000000000000..426b0058b8d7 --- /dev/null +++ b/sysutils/torque/files/pkg-message.in @@ -0,0 +1,40 @@ +*************************************************************** +You can find example configuration in + + %%PREFIX%%/share/examples/torque/var/spool/torque + +On all machines, both server and computing nodes, copy it's +contents into + + /var/spool/torque/ + +and put hostname of the server into + + /var/spool/torque/server_name + +On computing nodes, put '$pbsserver ip.address.of.server' into + + /var/spool/torque/mom_priv/config + +On server, put hostnames of computing nodes, one per line, into + + /var/spool/torque/server_priv/nodes + +On computing nodes, add the following line to /etc/rc.conf: + + pbs_mom_enable="YES" + +On TORQUE server, add the following lines to /etc/rc.conf: + + pbs_server_enable="YES" + pbs_sched_enable="YES" + +To configure queues on server, execute + + %%PREFIX%%/share/examples/torque/torque.setup <admin> + +For further information, see + + http://www.clusterresources.com/torquedocs21/ + +*************************************************************** |