Explore chapters and articles related to this topic
Introduction
Published in Randall L. Eubank, Ana Kupresanin, Statistical Computing in C++ and R, 2011
Randall L. Eubank, Ana Kupresanin
The first argument for both of these functions is a pointer to void. This is just a way of passing generic data into and out of the functions. The quantity buf appears in both the Send and Recv functions. This is the data that is being sent by Send and received by Recv. The (third) datatype argument is used to describe the contents of buf as some specific data type that is recognized by MPI. Such data types include all the common ones in C++ as well as those that are user defined. The latter option will not be explored here. For our purposes it is enough to know that, for example, MPI: :CHAR, MPI: :INT, MPI: :LONG, MPI : : UNSIGNED_LONG, MPI : : FLOAT, MPI : : DOUBLE, MPI : :LONG_DOUBLE and MPI : :BOOL correspond to the C++ primitive data types char, int, long, unsigned long, float, double, long double and bool, respectively.
Arbogast : Higher order automatic differentiation for special functions with Modular C
Published in Optimization Methods and Software, 2018
Isabelle Charpentier, Jens Gustedt
C is undergoing a continued process of standardization and improvement and, over the years, has added features that are important in the context of this study: complex numbers, variable length arrays (VLA), long double, the restrict keyword, type generic mathematical functions (all in C99), programmable type generic interfaces (_Generic), choosable alignment and Unicode support (in C11) (see [27]). Contrary to common belief, C is not a subset of C++. Features such as VLA, restrict and _Generic that make C interesting for numerical calculus do not translate to C++. Moreover, its static type system, fixed at compile time, and its ability to manage pointer aliasing make C particularly interesting for performance critical code. These are properties that are not met by C++, where dynamic types, indirections and opaque overloading of operators can be a severe impediment for compiler optimization. Unfortunately, these advantages of C are met with some shortcomings. Prominent among these is the lack of two closely related features, modularity and reusability, that are highly desirable in the context of AD.