[torquedev] OS-Specific #define's
josh at clusterresources.com
Tue Feb 12 12:45:10 MST 2008
A colleague and I have been making small changes to TORQUE 2.3--in a branch off of the trunk for a
specific customer. Some of these changes have been operating system specific, but the code has not
been in one of the resmom directories. Most of our changes have been in mom_main and start_exec.
Once these changes are fully tested, we will be merging them back into the main trunk.
I've noticed that TORQUE does define a macro named "PBS_MACH" that contains the name for the
operating system detected at configure time. This is useful information, but this macro can't be
easily used in an #ifdef to include/exclude code at compile time. (Unless there is a standard way to
do string comparisons with an #ifdef that I don't know about.) So here is my question to the
development community: would it be worthwhile to have configure add an OS-specific macro in
pbs_config.h, along with the PBS_MACH? (It would be something like __LINUX, __SOLARIS, __FREEBSD,
etc.) Or would it be better to simply refactor the code so it points to a new routine contained in
the resmom directories? If the latter is preferable, we still may need a way to determine between OS
versions--like between FreeBSD5 and FreeBSD6; code for both versions are contained in the "freebsd5"
resmom directory, but there may be code changes depending on which version is actually being used.
Let me know what you think,
More information about the torquedev