[torquedev] Reorganizing TORQUE Source Code
jbernstein at penguincomputing.com
Tue Feb 24 15:23:22 MST 2009
Josh Butikofer wrote:
> TORQUE Developers:
> Over the past few months I've been looking through the TORQUE source
> code and trying to find ways to improve its organization. I've found
> that there are several pieces of code that are data structures and
> utility functions used in both pbs_server and pbs_mom that are NOT part
> of the shared library package. This is fine, except for the fact that in
> some cases the functions/data structures are defined twice--once in
> pbs_mom code and once in pbs_server code. Oftentimes it is a direct copy
> and paste. In my mind this is not only silly, but potentially dangerous,
> as keeping these two copies in sync is a maintenance burden.
> I've also found that I want to add a generic function to TORQUE, but am
> forced to add it to some unrelated module like "job_func.c"...even
> though it has NOTHING to do with jobs, per se.
> So I have a proposal.
> We would like to create a new "utility" module in TORQUE. This C module
> would be statically linked into both the pbs_server and pbs_mom at
> compile time. It would NOT be part of the shared library, but it would
> still be found in its own "Libutil" directory. We would move any
> functions defined/used by both pbs_server and pbs_mom into this module,
> as well as any other functions that are generic enough that it would
> warrant their placement there.
> We already have a patch to do this work and are eager to check it in. I
> just wanted to double check if there are any objections or if anyone has
> any reservations. We plan on introducing this reorganized code into the
> next version of TORQUE 2.3.x. (No code logic is actually changing, so
> the functionality should remain exactly the same.)
> Let me know what you think.
Seems to make sense to me. At the very least it should make it easier to add new
functionality to TORQUE in the future.
More information about the torquedev