[torqueusers] 2.1.9 on BSD 6.2

Alexander Saydakov saydakov at yahoo-inc.com
Mon Nov 19 11:39:44 MST 2007


Hi!

I have tried Torque 2.1.9 on FreeBSD 6.2. Nodes report crazy load averages,
so the server thinks that nodes are busy. I suspect it has to do with *rv =
(double)la[0]/(double)FSCALE in src/resmom/freebsd5/mom_mach.c

I patched it like this, after which it works great:

*** 1801,1823 ****
        double  *rv;
  {
        char    *id = "get_la";
-       long    la[3];

        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);
        }

-       *rv = (double)la[0]/(double)FSCALE;
        return 0;
  }

--- 1801,1816 ----
        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;
  }


I am not quite sure if the patch would work for BSD5. Say, BSD4 does not
seem to have kvm_getloadavg()

And I suppose you know already that Torque 2.2.1 does not even compile on
both BSD4 and BSD6.2





More information about the torqueusers mailing list