Re: [HTCondor-devel] [htcondor-fw] Platform changes in master


Date: Thu, 18 Feb 2021 09:50:39 -0600
From: Greg Thain <gthain@xxxxxxxxxxx>
Subject: Re: [HTCondor-devel] [htcondor-fw] Platform changes in master
(Forwarding to htcondor-devel)

This is a good step forward. GCC minimum version 7.3 everywhere means that we can change to using C++14 in the master branch. 14 is not a huge delta from C++11, but there are some handy things we can use:

o) The apostrophe character can be used in numeric literals like a comma would be in written numbers. The apostrophe is ignored, and can go anywhere, e..g

const int one_million = 1'000'000;

This might be a nice little feature to add to classads someday, in the usual way (add it to the lexer, then wait 10 years before documenting it)

o) constexpr functions are marginally more useful -- they can now contain loops. Remember, constexpr functions are those that can be evaluated at compile time, but may get evaluated at runtime, depending on context. This is a big push for C++ in general, and constexpr functions get progressively more expressive in C++17 and C++20 to the point where you can std::sort a vector of strings at compile time in C++ 20. One can think of all kinds of applications for that in HTCondor.

o) std::unique_ptr's that use the standard delete'r can (and should!) be made with the template function std::make_unique<T>. This save a bunch of typing, and mimics std::make_shared<T> (which actually is more efficient than using the std::shared_ptr<T> constructor.

e.g. use

auto c = std::make_unique<std::string>("Constructor Args");

instead of

std::unique_ptr<std::string> c(new std::string("Constructor Args"));

o) In 14, associated containers like std::map can now be queried not just by the exact type of the key, but by any type that can be compared to the key with operator<. This means that a map keyed by std::string can be queried with a char * without creating a temporary std::string. This could help ClassAd Lookup performance.

o) Finally, this means that all of our platforms implement std::string with the Small String Optimization. That is, there is no more free copy-on-write std::strings. The size of std::strings is on the order of 24 bytes on all our platforms, and any short string can be stored in a string object without allocation. I suspect this is a net win for the collector, but we should measure it.

-greg

On 2/17/21 9:44 PM, Tim Theisen via htcondor-fw wrote:
Now that the master branch is slated for 9.1 development, we have
dropped some older platforms and will be able to leverage newer versions
of software. Here are the major changes:

GCC upgrade: I have placed devtoolset-9 on our EL7 machine and Docker
image. So, GCC 9.3.1 is used to build HTCondor on those hosts. So, the
minimum GCC version in use is GCC 7.3.1 on Amazon Linux 2.

CMake upgrade: We now build using cmake3 from EPEL on EL7. So, our
minimum cmake version is 3.8.2 on Windows. If we upgrade CMake on
Windows, then our minimum CMake version would be 3.10.2 on Ubuntu 18.

Python 3: Now that we have dropped Debian 9 and Ubuntu 16, we have
gotten rid of the last Python 3.5 machines. So, our minimum Python
version is 3.6 on Windows and Python 3.6.8 on CentOS 7 and 8.

Enjoy the technology upgrade.

...Tim

[← Prev in Thread] Current Thread [Next in Thread→]
  • Re: [HTCondor-devel] [htcondor-fw] Platform changes in master, Greg Thain <=