J I Cardesa
email: jcardesa@imft.fr

L Hascoët

C Airiau

Adjoint computations by algorithmic differentiation of a parallel solver for time-dependent PDEs

Keywords: Algorithmic differentiation, computational fluid dynamics, sensitivity analysis, adjoint methods, parallel computing

A computational fluid dynamics code is differentiated using algorithmic differentiation (AD) in both tangent and adjoint modes. The two novelties of the present approach are 1) the adjoint code is obtained by letting the AD tool Tapenade invert the complete layer of message passing interface (MPI) communications, and 2) the adjoint code integrates time-dependent, non-linear and dissipative (hence physically irreversible) PDEs with an explicit time integration loop running for ca. 10 6 time steps. The approach relies on using the Adjoinable MPI library to reverse the non-blocking communication patterns in the original code, and by controlling the memory overhead induced by the time-stepping loop with binomial checkpointing. A description of the necessary code modifications is provided along with the validation of the computed derivatives and a performance comparison of the tangent and adjoint codes.

Introduction

Numerical codes in engineering and physical sciences are most often used to approximate the solution of governing equations on discretized domains. A natural step beyond obtaining solutions in specific conditions is to seek those conditions that modify the solution towards a specific goal, either for optimization or control purposes. In this context, gradient-based methods play an important role. They require invariably the computation of derivatives, a task that can be automated by Algorithmic Differentiation (AD) tools. In short, AD augments a given "primal" code that initially computes outputs Y i from inputs X j into a "differentiated" code that additionally computes some derivatives dY i /dX j requested by the user. AD provides two main modes, the tangent/direct/forward mode and the adjoint/reverse/backward mode. If 1 ≤ i ≤ p and 1 ≤ j ≤ q bound the dimension of the output and input spaces, respectively, then the tangent mode is most efficient when q p while the adjoint mode is the only realistic option for p q. Many real life applications require computing derivatives of relatively few outputs (cost functions, constraints. . . ) with respect to many inputs (state variables, design parameters, mesh coordinates. . . ). Adjoint AD would fit those applications perfectly since p q. However, two features of high-performance codes used in industry and academia have been playing against that: parallel communications and unsteady computations. The reason is the amount of resources needed to reverse the data-flow and control-flow of such long and complex computations [START_REF] Griewank | Evaluating derivatives: principles and techniques of algorithmic differentiation[END_REF]. As long as the adjoint mode provided by AD tools did not address these serious limitations, most studies [START_REF] Kenway | Effective adjoint approaches for computational fluid dynamics[END_REF][START_REF] Müller | STAMPS: a finite-volume solver framework for adjoint codes derived with source-transformation AD[END_REF][START_REF] Xu | Stabilisation of discrete steady adjoint solvers[END_REF] circumvented them by using the following strategies:

• Applying AD on selected parts of the code without MPI calls and manually assembling the differentiated routines to obtain a correct adjoint code. • Restricting the use of AD to code solving problems that are either stationary or forced to become stationary. As an exception, earth sciences have long used adjoints of unsteady simulations [START_REF] Charpentier | Checkpointing schemes for adjoint codes: application to the meteorological model Meso-NH[END_REF][START_REF] Heimbach | An efficient exact adjoint of the parallel mit general circulation model, generated via automatic differentiation[END_REF], pioneering the so-called checkpointing schemes [START_REF] Griewank | Achieving logarithmic growth of temporal and spatial complexity in reverse automatic differentiation[END_REF][START_REF] Grimm | Optimal time and minimum space-time product for reversing a certain class of programs[END_REF] that we advocate here. • Using lower accuracy models or otherwise "compressed" representations of the forward trajectory -see, for example, [START_REF] Götschel | Lossy compression for pde-constrained optimization: adaptive error control[END_REF]. This approach has been frequently used as part of "multifidelity" modeling.

In this paper, we report on the outcome of exploiting the recently acquired maturity of AD tools [START_REF] Hückelheim | Algorithmic differentiation of code with multiple context-specific activities[END_REF] at differentiating parallel code in adjoint mode by automatic inversion of the MPI communication layer [START_REF] Utke | Toward Adjoinable MPI[END_REF] while handling the cost of an unsteady computation.

The paper is organized as follows. In section 2 we describe the code to be differentiated and the current developments of adjoint AD for parallel codes and unsteady computations. In section 3 we introduce the two test cases analyzed, section 4 explains in detail the process of code differentiation that we followed, section 5 presents our results and we offer our conclusions in section 6.

Background

Primal code description

The code under consideration in the present study -hereafter the primal code -is a computational fluid dynamics (CFD) solver that integrates the governing equations for compressible fluid flow. It belongs to a recent trend of CFD codes that use a highorder spatial discretization adapted to compressible/incompressible flow computations on complex geometries modeled by unstructured meshes. This makes them suitable candidates to become industrial tools in the near future [START_REF] Witherden | Future directions in computational fluid dynamics[END_REF]. Our application code is JAGUAR [START_REF]Comparison of various CFD codes for LES simulations of turbomachinery: from inviscid vortex convection to multi-stage compressor[END_REF][START_REF] Cassagne | Jaguar: a new CFD code dedicated to massively parallel high-order LES computations on complex geometry[END_REF], a solver for aerodynamics applications developed to suit the future needs of the aerospace industry. Its excellent scalability, its ability to handle structured or unstructured grids, its optimized 6-step time integration scheme as well as its high-order spatial discretization based on spectral differences [START_REF] Jameson | A proof of the stability of the spectral difference method for all orders of accuracy[END_REF][START_REF] Kopriva | A staggered-grid multidomain spectral method for the compressible navierstokes equations[END_REF][START_REF] Liu | Spectral difference method for unstructured grids I: basic formulation[END_REF][START_REF] Van Den Abeele | On the stability and accuracy of the spectral difference method[END_REF][START_REF] Vanharen | Revisiting the spectral analysis for high-order spectral discontinuous methods[END_REF] are all positive features which inevitably come at a price: the code is complex. Its manual differentiation for sensitivity computations is impractical, thus making AD an attractive solution. The code is written following features from the Fortran 90 standard onward, with a zero-halo partitioning scheme and an MPI-based parallelisation. The version available for the present study used no thread pinning or dynamic load balancing.

Overloading versus source-transformation AD tools

AD can be based on two working principles: operator overloading (OO) or source transformation (ST). The OO approach barely modifies the primal code: the data-type of numeric variables is simply modified to contain their derivative in addition to their primal value, while arithmetic operations are overloaded to act on both components of the variables. While the debate is still active, it is generally agreed that ST AD tools require a much heavier development, which is in general paid back by a better efficiency of the differentiated code mostly in terms of memory consumption. Benchmark tests have pointed out a tendency for OO-differentiated codes to be more memory demanding and somewhat slower than their ST counterparts [START_REF] Kenway | Effective adjoint approaches for computational fluid dynamics[END_REF]. On the other hand, the more flexible OO model can be applied at a low development cost to languages with sophisticated constructs, such as C++ or Python, for which no general-purpose ST tool exists to date. For a given application, the choice between AD tools based on ST or OO is dictated by these constraints: with JAGUAR being written in Fortran, ST appears to be the natural choice. Moreover, for the size and number of time steps of our targeted applications, it is essential to master the memory footprint of the final adjoint code. For this study, we have selected the ST-based AD tool Tapenade [START_REF] Hascoët | The Tapenade automatic differentiation tool: principles, model, and specification[END_REF].

AD of very long time-stepping sequences

The adjoint mode of AD leads to a code which executes the differentiated instructions in the reverse order of the primal code. However, these differentiated instructions (the "backward sweep") use partial derivatives based on the values of the variables from the primal code. The primal code, or something close to it, must therefore be executed beforehand, forming the "forward sweep". As codes generally overwrite variables, a mechanism is needed to recover values overwritten during the forward sweep, as they are needed during the backward sweep. Recovering intermediate values can be done either by recomputing them at need, from some stored state, or by storing them on a stack during the forward sweep and retrieving them during the backward sweep. Neither option scales well on large codes, either with a memory use that grows linearly with the primal code run time, or with an execution time that grows quadratically with the primal code run time. We envision applications with 10 5 to 10 6 time steps to integrate the fluid flow equations. The classical answer to this problem is a memoryrecomputation trade off known as "checkpointing" [START_REF] Griewank | Evaluating derivatives: principles and techniques of algorithmic differentiation[END_REF]. A well-chosen checkpointing strategy can lead to execution time and memory consumption of the adjoint code that grow only logarithmically with the primal code run time.

A checkpointing strategy is constrained by the structure of the primal code. Checkpointing amounts to designating (nested) portions of the code, for which we are ready to pay replicate execution to gain memory storage of its intermediate computations. These portions must have a single entry point and a single exit point, for instance procedure calls or code parts that could be written as procedures. For this reason one cannot in practice implement the theoretical optimal checkpointing scheme, which is defined only on a fixed-length linear sequence of elementary operations of similar cost and nature. A checkpointing scheme on a real code can still achieve a logarithmic behavior, but in general below the theoretical optimal. Since checkpointing relies on repeated execution, it requires storing and restoring a "state", which is a subset of the memory and of the machine state such that the repeated execution matches the original. This implies that the checkpointed code portion is "reentrant", i.e. avoids side-effects, so that running the portion twice does not alter the rest of the execution. As a consequence, a checkpointed portion of code must always contain both ends of an MPI communication, and similarly both halves of a non-blocking MPI communication [START_REF] Hascoët | Programming language features, usage patterns, and the efficiency of generated adjoint code[END_REF]. Time-stepping simulations are more fortunate: at the granularity of time steps, the code is indeed a fixed-length sequence of elementary operations of similar cost and nature. The binomial checkpointing scheme [START_REF] Walther | Advantages of binomial checkpointing for memory-reduced adjoint calculations[END_REF] exactly implements the optimal strategy in that case, and Tapenade applies it when requested. Binomial checkpointing also reduces the state restoration runtime overhead, through multiple restorations of each stored state. A checkpointing strategy is also constrained by the characteristics of the storage system. The binomial strategy assumes a uniform and negligible cost for storing and retrieving the memory state before checkpoints ("snapshots"). This is in reality never the case. New research [START_REF] Aupy | Periodicity in optimal hierarchical checkpointing schemes for adjoint computations[END_REF][START_REF] Aupy | Optimal multistage algorithm for adjoint computation[END_REF] looks for checkpointing strategies that take this memory cost into account, as well as different access times for different memory levels.

In general, few studies confront unsteady problems directly, and most works reported in the literature focus on problems around a fixed-point solution. Convergence towards that fixed steady state is often enforced by means of implicit iterative schemes with preconditioning. Few iterations are necessary, and only the final converged state requires storage before computing the inverted set of instructions. Consequently, memory and computational overhead are kept low. It is unfortunate, however, that many problems of industrial relevance are inherently unsteady. In acoustics and combustion, for instance, unsteadiness simply cannot be ignored, which is what motivates the present study.

Naïve vs. selective AD

The AD tool requires that the function to be differentiated is designated in the primal code as a "head" procedure. If the function is scattered over several code parts, one must modify the primal code to make the head procedure appear -an acceptable technical constraint. The AD tool will then consider the complete sub-graph of the primal code's call graph that is recursively accessible from the head. It will analyze it and differentiate it as a whole, in one single step. Each procedure under the head will be differentiated with respect to its "activity pattern", i.e. those of its inputs and outputs that are involved in a dependence between the selected head procedure inputs and the selected head procedure outputs. This approach is referred to as "brute force" [START_REF] Jones | Preparation and assembly of discrete adjoint CFD codes[END_REF] and "full-code" AD [START_REF] Kenway | Effective adjoint approaches for computational fluid dynamics[END_REF] in two works that deem the approach inefficient, compared to manual assembly of individually differentiated procedures with user-provided activity patterns. The inefficiency may come in part from the unavoidable imprecision of the static data-flow analysis that detects the differentiated inputs and outputs of each procedure. Static analysis has to make conservative approximations, that lead to larger activity patterns than actually needed. One answer to that could be to use differentiation pragmas, not provided at present in Tapenade. The inefficiency may also have come from the superposition of activity patterns coming from a procedure's different call sites. The situation has now improved, with Tapenade allowing a procedure to have several differentiated versions, potentially one for each activity pattern encountered [START_REF] Hückelheim | Algorithmic differentiation of code with multiple context-specific activities[END_REF].

Parallel communications

Parallelism is in general a challenge for AD, especially in adjoint mode, since variable reads give birth to adjoint variable increments. By design, the MPI distributed memory model at least evacuates the risk of race conditions that would arise in other models such as OpenMP. Much conceptual work has been devoted to AD of MPI code [START_REF] Heimbach | Automatic generation of efficient adjoint code for a parallel Navier-Stokes solver[END_REF][START_REF] Hovland | Automatic differentiation for message-passing parallel programs[END_REF][START_REF] Schanen | Second-order algorithmic differentiation by source transformation of MPI code[END_REF][START_REF] Schanen | A wish list for efficient adjoints of one-sided MPI communication[END_REF][START_REF] Schanen | Interpretative adjoints for numerical simulation codes using mpi[END_REF]. However, it is with the recent advent of the Adjoinable MPI library [START_REF] Utke | Toward Adjoinable MPI[END_REF] that several AD tools (Adol-C, Rapsodia, dco, OpenAD, Tapenade) support AD of code containing MPI calls. Related projects include the Adjoint MPI library [START_REF] Schanen | Second-order algorithmic differentiation by source transformation of MPI code[END_REF][START_REF] Schanen | Interpretative adjoints for numerical simulation codes using mpi[END_REF][START_REF] Towara | MPI-parallel discrete adjoint openfoam[END_REF] compatible with the dco suite of AD tools, and CoDiPack [START_REF] Sagebaum | High-performance derivative computations using CoDiPack[END_REF] for C++ code -both based on OO. The automatic inversion of MPI calls necessary to derive a parallel adjoint code can thus be performed by three tools. In [START_REF] Towara | MPI-parallel discrete adjoint openfoam[END_REF], the CFD code OpenFOAM was adjointed with the combination of dco/c++ and Adjoint MPI. CoDiPack was used to adjoint the CFD code SU2 [START_REF] Albring | Efficient aerodynamic design using the discrete adjoint method in SU2[END_REF]. To our knowledge, these are the most similar studies to ours in terms of letting the AD tool handle the parallel communication layer automatically -yet without solving a time-dependent problem.

An attractive choice is to restrict AD to parts of the code devoid of MPI communications. The individually differentiated fragments can then be manually assembled into an adjoint code that preserves the often heavily optimized parallel communications layer of the primal code. A disadvantage of this approach is the increased workload incurred every time a different problem is tackled, where the optimization concerns different quantities from those previously considered. A certain degree of freedom in choosing the cost function and automation in assembling differentiated procedures has been achieved in [START_REF] Müller | STAMPS: a finite-volume solver framework for adjoint codes derived with source-transformation AD[END_REF]. Alternatively, [START_REF] Hückelheim | Parallelizable adjoint stencil computations using transposed forward-mode algorithmic differentiation[END_REF] has presented the transposed forward-mode algorithmic differentiation to take advantage of those code portions featuring symmetric properties in order to obtain adjointed code using the forward-mode AD. Either way, handling MPI calls differently from the rest of the code contradicts the ultimate goal of AD, which is full automation of the differentiation process regardless of the programming features actually used in the primal code. It is true, however, that each specific library that involves side-effects raises new issues, limitations, and challenges that cannot be readily solved by AD tools. Given the efforts that have been devoted towards making MPI calls compatible with AD tools [START_REF] Heimbach | Automatic generation of efficient adjoint code for a parallel Navier-Stokes solver[END_REF][START_REF] Hovland | Automatic differentiation for message-passing parallel programs[END_REF][START_REF] Schanen | Second-order algorithmic differentiation by source transformation of MPI code[END_REF][START_REF] Schanen | A wish list for efficient adjoints of one-sided MPI communication[END_REF][START_REF] Schanen | Interpretative adjoints for numerical simulation codes using mpi[END_REF], we aim to test and document the outcome of letting the AD tool handle them alone. In this respect, our work intends to provide a proof of concept illustrating that the route followed, which on the whole has been avoided in the literature, is in fact practicable.

Test cases

Incompressible, viscous, two-dimensional double shear layer in a periodic square

We consider a viscous, two-dimensional incompressible flow in a square periodic domain spanning L = 1 in the streamwise (x) and vertical (y) directions. The velocity field at the initial instant t 0 is given by

u = U tanh [r (y -1/4)] , y ≤ 1/2 (1) u = U tanh [r (3/4 -y)] , y > 1/2 (2) v = U δ sin [2π (x + 1/4)] , (3)
where all quantities are made non-dimensional with L and the streamwise reference velocity U 0 = 1 as follows: 1. The three perturbation amplitudes U corresponding to the 3 shear parameters r used in Figure 2.

t = t U 0 /L, y = ỹ/L, x = x/L, U = Ũ /U 0 , r = r L. (4)
U is computed with Equation [START_REF] Cassagne | Jaguar: a new CFD code dedicated to massively parallel high-order LES computations on complex geometry[END_REF]. In all cases, the constraint of an initial enstrophy of Ω ref = 53.36 is applied.

The parameters of the problem are U , r and δ. These are the streamwise velocity amplitude, the shear parameter and the ratio of vertical to streamwise velocity amplitudes, respectively. We set δ = 0.05 for the remainder of this study so that it is no longer a free parameter. We analyze the evolution of the overall enstrophy Ω, defined as

Ω = 1 0 1 0 1 2 ω 2 z dx dy, (5)
where ω z = ∂ x v -∂ y u is the vorticity. It can be readily shown from Equations ( 1)-( 3) and ( 5) that at t = t 0 ,

Ω = U 2 6r tanh(r/4) -2r tanh 3 (r/4) + 3δ 2 π 2 /3, (6)
and we choose r = 40 with U = 1 to yield an initial enstrophy level Ω ref = 53.36 which we set as a constraint for all r. This implies U is a function of r only, determined by re-arranging Equation ( 6) as follows:

U (r) = 3Ω ref / 6r tanh(r/4) -2r tanh 3 (r/4) + 3δ 2 π 2 1/2 . (7)
The Reynolds number Re 0 = U 0 L/ν = 1.176 × 10 4 is the same for all values of r we consider, which are displayed on Table 1. We display ω z (x, y) for the case r = 160 at four different instants on Figure 1, and Ω(t) for the three cases on Figure 2. The time dependence of the flow is clear, albeit to a lesser extent in the final stage where two large vortices slowly decay under the action of viscosity. The motivation behind choosing this specific test case is that we have effectively created an unsteady physical system where we can tune the dynamics with a single parameter. We also intend to illustrate that a viscous flow, hence dissipative and irreversible from a physical point of view, can safely be treated by the adjoint-mode of AD executing the temporal integration in backwards mode. It is sometimes pointed out that this type of problems can lead to unstable schemes by drawing analogies with physical irreversibility and negative diffusivity. Finally, we aim to show that unsteady problems governed by nonlinear equations do not necessarily lead to the failure of sensitivity analysis due to chaos, thus requiring shadowing techniques such as those in [START_REF] Blonigan | Least-squares shadowing sensitivity analysis of chaotic flow around a two-dimensional airfoil[END_REF].

The incompressible 2D Navier-Stokes equations are solved with the initial and boundary conditions outlined above using JAGUAR on a structured mesh with 72×72 square elements. The Mach number (M a) is set to zero to approach, as much as possible, incompressibility. The solution and flux points are located following Gauss-Lobatto-Chebyshev and Legendre collocation, respectively, and the CFL is kept constant at 0.5. The fluxes at the cell faces are computed with the Roe scheme. The temporal integration is done with a six-stage, fourth-order low-dissipation low-dispersion Runge-Kutta scheme optimized for the spectral difference code using the procedure there is no viscosity in the set of equations solved by JAGUAR. We consider two levels of compressibility: close to incompressible with M a = 0.1, and a higher subsonic regime with M a = 0.5. Both are below the critical Mach number, so no shock appears on the upper side of the airfoil. Yet at M a = 0.5, we expect to see sizable departures from predictions based on two-dimensional, incompressible and inviscid (i.e. potential) flow predictions. The domain is discretized with a structured mesh of 2876 quadrilateral elements. We are interested in the derivative of the lift coefficient Cl with respect to α at α = 0 • . This frequently computed quantity allows for comparison with experimental measurements [START_REF] Mccroskey | Technical evaluation report on the fluid dynamics panel symposium on applications of computational fluid dynamics in aeronautics[END_REF] and with numerical computations based on the potential flow solver XFOIL [START_REF] Drela | Xfoil: An analysis and design system for low reynolds number airfoils[END_REF]. Figure 3 shows the Mach number distribution around the airfoil for the angle of attack α = 4 • , computed by JAGUAR with the same mesh as the α = 0 • case. At this α setting, an asymmetric pressure distribution gives rise to lift due to the faster flow on the upper side -yet subsonic conditions are mantained.

Sensitivity validations with finite differences

The estimates of a given sensitivity computed with tangent-or adjoint-mode AD codes should agree almost to machine precision, as they result from the same computation modulo associativity-commutativity. In contrast, the reference value against which to validate the sensitivity is obviously a finite-difference (FD) estimate, which is subject to errors due to the contribution of higher derivatives. For the viscous test case, we compute our FD estimates with two independent realizations at r and r + dr, where dr/r = 10 -5 . Similarly, for the inviscid test case we use two independent realizations at α and α + dα, where dα/α = 10 -5 . We thus expect an agreement between FD and AD derivatives up to more or less half of the decimals, whereas we expect a much better agreement between tangent AD and adjoint AD derivatives.

Differentiation work flow

We adopted the following work flow with regards to the JAGUAR flow solver, the working principles of Tapenade and the Adjoinable MPI library: A) Identify the part of the code that computes the function to differentiate, exactly from the differentiation input variables to the differentiation output, and make it appear as a procedure (the "head" procedure of section 2.4). This may require a bit of code refactoring. The differentiation tool must be given (at least) this root procedure and the call tree below it. B) Migrate all MPI calls to Adjoinable MPI, whether AD will be applied in tangent or in adjoint mode. This involves two steps. First, as Adjoinable MPI does not support all MPI communication styles (e.g. one-sided), the code must be transformed to only use the supported styles, which is a reasonably large subset. Second, effectively translate the MPI constructs into their Adjoinable MPI equivalent, which occasionally requires minor modifications to the call arguments. As Adjoinable MPI is just a wrapper around MPI, the resulting code should still compile and run, and it is wise to test that. C) Provide the AD tool with the source of the head procedure and of all the procedures that it may recursively call, together with the specification of the differentiation input and output variables. Then differentiate, after which two steps follow. First, fix all issues signaled by the AD tool, e.g. unknown external procedures or additional info needed, and validate the differentiated code. Second, address performance issues and in particular optimize the checkpointing strategy by adding AD-related directives to the source. This may also involve special treatment of linear algebra procedures such as solvers.

Step A) is best illustrated with the viscous test case. The main program in JAGUAR calls thirteen procedures before r is used to initialize the velocity field. r has thus no impact on the code prior to the velocity field initialization. A few procedure calls after the initialization, the time integration routine is called, at the end of which J is known. All code after that point has no impact on the sensitivity computation we investigate. So we create a head that contains all procedure calls from the velocity field initialization to the time integration routine, excluding everything else. This head, say TopSub(X,Y), takes X = r as input and outputs Y = J. It will be differentiated in step C).

The work involved in step B) is likely to depend heavily on the primal code and the state of advancement in the Adjoinable MPI project at the time of implementation. Codes tuned for high-performance computing which repeat a non-blocking communication pattern many times benefit from using persistent communication requests through the MPI SEND INIT and MPI SEND RECV calls. This leads to the later use of the MPI STARTALL and MPI WAITALL constructs when the communications are actually invoked. These communication patterns are not currently supported by the Adjoinable MPI library, and the advice of the developers in such cases is to replace them by loops over processes containing individual non-blocking MPI ISEND, MPI IRECV and their respective MPI WAIT calls. The output of the modified primal code needs to be validated against the original version, which can be done reliably on a small number of processes. The impact of the modifications on the performance, however, is difficult to assess without access to hundreds, preferably thousands of cores. With 16 cores, we record a performance drop of 2.6% after 3.5 × 10 5 time steps on the inviscid test case. Since the modified code preserves the non-blocking structure of the original code, we expect the performance drop to be low. The drop should be attributed to the overhead for communication between the process and the communication controller, which is what persistent communications alleviate -and not between one communication controller and another. All in all, support for persistent communications would be a useful addition to the Adjoinable MPI library.

Migrating from MPI to Adjoinable MPI involves changes that are mainly cosmetic. The name of each MPI call requires relabeling to match the name of the Adjoinable MPI wrapper for that call. Typically, all that needs to be done is to change CALL MPI COMM SIZE, CALL MPI BARRIER, CALL MPI ALLREDUCE, etc. into CALL AMPI COMM SIZE, CALL AMPI BARRIER, CALL AMPI ALLREDUCE and so on. These modifications can be automated with a suitable script. For each point-to-point Adjoinable MPI call, however, the user has to manually add an argument that specifies the kind of MPI call at the other end of the communication. For example, the extra argument for a send instruction may be AMPI TO RECV, AMPI TO IRECV WAIT or AMPI TO IRECV WAITALL. Similarly, the extra argument for a receive may be AMPI FROM SEND, AMPI FROM ISEND WAIT, AMPI FROM ISEND WAITALL. This must be left to the programmer, as no static data-flow analysis can determine it in general.

In step C), specific instructions can be passed on to tune how Tapenade should handle the checkpointing of the primal code. The most important part in specifying these is to identify the time-stepping loop(s), to label them for binomial checkpointing, and to assign them a well-chosen number of snapshots. It can be done by placing a number of specific directives in the source code, to indicate which subroutine calls should be checkpointed portions. By default, all of them are. This is a delicate trade off, of experimental nature. The rule of thumb is to avoid checkpointing on "small" procedures, as they require very little space on stack and on the other hand may require a large snapshot for checkpointing. Typically a subroutine that takes in an array and an index to just overwrite the array element at this index is considered "small" and should not be checkpointed. A case of forbidden checkpointing, detailed in [START_REF] Hascoët | Programming language features, usage patterns, and the efficiency of generated adjoint code[END_REF], is a subroutine that contains one end of a non-blocking communication, for example the MPI ISEND or the MPI IRECV, but not the corresponding MPI WAIT. The subroutine is not reentrant and must not be checkpointed. In our application, this happened on two procedures. For completeness, we must point out a manual modification required on the adjoint code, i.e. after step C). At the "turning" point between forward and backward sweeps, one must insert specific calls to declare, for each primal variable V that is active (i.e. it has a derivative) and that is passed through MPI, the correspondence with its derivative counterpart Vb. Specifically, this is done by calling ADTOOL AMPI Turn(V, Vb). This must be done by hand, until Tapenade generates these calls automatically.

The differentiation of the head routine TopSub(X,Y) leads to TopSub d(X,Xd,Y,Yd) in tangent mode and to TopSub b(X,Xb,Y,Yb) in adjoint mode. The final program calls the differentiated routines when derivatives are needed. In doing so, it is necessary to correctly set the initial Xd (respectively Yb) and to correctly interpret the resulting Yd (resp. Xb). For parallel execution specifically, the full sensitivity could be spread across the Xb of several processes after having seeded all of them with Xb=0 and Yb=1. In such cases, a global reduction operation is needed to sum the resulting Xb held by each process in order to recover the correct sensitivity. Strategies for handling the dispersion of the derivatives across different processes in adjoint-mode AD have been discussed in [START_REF] Schanen | Semantics driven adjoints of the message passing interface[END_REF].

Let us finally comment on our experience using an AD tool on a large parallel code. The difficulties encountered on the AD tool side, including 3 bug reports, will no longer stand on the way of future attempts at performing a similar study. This gives a rough idea of the maturity, or lack thereof, of the Tapenade tool. Issues with the Adjoinable MPI library were limited to the lack of support, at the time of writing, for persistent communication requests. The fact that Tapenade does not yet introduce automatically the needed calls to ADTOOL AMPI Turn is a limitation. We would like to think that having one developer of the AD tool among us is not a prerequisite for success. The three bugs mentioned above were fixed after being reported by email. Performance tuning of the adjoint code is not yet optimal, and we believe this calls for better support from the AD tool for choosing a good checkpointing scheme.

Results

Viscous double shear layer

Differentiation method Sensitivity (dJ/dr) FD (MPI) -0.22002254 Tangent AD (AMPI) -0.22002394265381 Adjoint AD (AMPI) -0.22002394265861

Table 2. dJ/dr computed with three different methods, for the time integration interval between t = 0 and t = T (6.8 × 10 5 time steps). Viscous test case with r = 160, run on 16 parallel processes.

The temporal integration of the equations of motion is carried out from t = 0 to the n -th iteration of the time integration loop in JAGUAR, with n = 6.8 × 10 5 . With the CFL setting outlined in section 3, this number of time steps corresponds to t Ω ref = 19.8, which from Figure 1 can be seen as the time when the decay of Ω becomes slow for all three values of r. The value of dJ/dr is given in Table 2, where the results from FD, tangent-mode AD and adjoint-mode AD are all gathered. The agreement between FD-based sensitivities and AD validates the differentiation procedure. In particular, we note that although the underlying system is unsteady and results from non-linear equations, there is no breakdown of the conventional sensitivity analysis. It is important to emphasize this because, as illustrated by [START_REF] Blonigan | Least-squares shadowing sensitivity analysis of chaotic flow around a two-dimensional airfoil[END_REF] for the Lorentz attractor, unsteadyness and chaos can undermine sensitivity computations and motivate the use of more complex approaches. But our system, although unsteady and non-linear, does not fall into the category of problems that require these approaches.

The agreement between the two AD-based sensitivities is excellent, within round-off error of double precision arithmetic. It was expected in case of correct differentiation by Tapenade, but nevertheless it is puzzling when comparing the drastic differences between the two differentiated codes. The fact that the adjoint-differentiated code outputs the correct answer after carrying out the time-stepping loop backwards confirms the absence of any stability or convergence issues related to inverting the instructions of a code that integrates in time an irreversible and dissipative system. More specifically, there is no issue of numerical instability caused by a term with negative diffusivity.

The time required for the various computations is shown on Table 3. A factor of two is indicated for the FD computation, given that two runs of the primal code are required. The computations are run on 16 Intel(R) Xeon(R) Gold 6140 processors at 2.30GHz. The Intel Fortran compiler version 18.0.2 is used, with identical optimization flags for all codes: -ipo -O3. The Intel MPI Library was used for the MPI implementation, in its 2018 version. It appears that the tangent-mode AD can be faster than two runs of the primal code, requiring 1.7 times the execution time of the primal code. The higher accuracy of sensitivity computations from tangent-mode AD thus comes with the added benefit of a faster computation than that of FD. Furthermore, each additional cost function differentiated with respect to r will require an additional FD computation, whereas the cost of each new sensitivity with respect to r will keep the cost of the tangent-mode execution constant. We note in passing that the FD computation is based on the MPI code before the modifications of step B) outlined in section 4, so that the tangent-mode AD is faster than the FD computations despite the move from MPI to Adjoinable MPI. This indicates that the cost of this additional wrapper on top of the MPI library is negligible. Table 3 also shows the slowdown factor of the adjoint code, which is 15.4 and deserves some discussion. An initial experiment without any specific checkpointing scheme simply ran out of memory after only less than a hundred time-stepping iterations. Therefore, binomial checkpointing is unavoidable. It accounts for a significant part of this adjoint slowdown: since we chose to allow for 80 snapshots for binomial reversal of 6.8 × 10 5 time steps, the binomial model tells us this costs an average 3.9 extra recomputations per time step. This leaves us with roughly an 11-fold slowdown to account for, which is still higher than expected. By far the most expensive task in JAGUAR is the computation of the right-hand side of the governing equations, required six times per time step by calling procedure ComputeRhsNavier. The latter can itself be decomposed into eight subroutines, shown on Figure 4 compared to its original version. 54% of the time taken by ComputeRhsNavier is spent during execution of GradientAndInternalFlux, so that the largest slowdown -almost 13 -occurs precisely within the most expensive routine. Calls to push and pop intermediate values into the AD stack are spread across all eight procedures, and for this reason we cannot ascribe the performance penalty incurred specifically in GradientAndInternalFlux to AD stack access only. However, we do note that improving the performance when reading and writing into the AD stack -which happens regardless of binomial checkpointing -will generally have a direct impact on adjointdifferentiated code speed. Future efforts on the AD tool side will be geared in that direction.

The type of information on Table 4 provides the AD user with indications on where to hand-tune the AD process further -by preventing some procedures from being checkpointed, for instance. But from here onwards, the process is no longer automatic and will depend heavily on the specific code under consideration. We therefore limit our study to the performance obtained "out of the box" with the current degree of maturity in the development of the AD tool, which has undergone major improvements over the years to reach its present state. With the obtained performance, the adjoint code is already preferable to the tangent code as soon as the number of input variables, with respect to which we request sensitivities, goes over 15.

Inviscid compressible flow around an airfoil

The flow around the airfoil converges to a steady state after integrating the governing equations for long enough. It can be seen on Figure 5 that both the FD approximation and the AD computation (only tangent-mode used) exhibit similar time-dependence during an initial transient phase, and then stabilize around a converged value. The FD and AD computations agree across both Mach numbers and throughout the time interval considered, validating the AD code. We also show the value obtained for the sensitivity using an altogether different code (XFOIL) and applying FD to it around the same airfoil geometry and for an angle of attack α = 0. The experimental curve fit shown on Figure 5 is for comparison, illustrating that the discrepancy between the various estimations of the same quantity is within reasonable bounds considering the difference between the approaches.

The time span on Figure 5 by the JAGUAR computations represents 4.3 × 10 5 and 1.2 × 10 6 time steps with Mach=0.1 and 0.5, respectively, using a CFL of 0.5 in both cases. The tangent-mode AD computations last 1.6 times the execution time of the corresponding primal code for both Mach numbers. For this test case, the computations are run on 27 Intel Xeon(R) Silver 4110 processors at 2.10GHz, with the Intel Fortran compiler version 15.0.1 and identical optimization flag for primal and AD codes: -O3. MPICH-3.2 was used. It is interesting to see that the ratio of run times between the tangent-differentiated and the primal code is very close to that obtained for the previous test case, which was 1.7. The primal codes of both test cases differ due to the presence of additional code lines related to the viscous stresses.

Conclusions and future work

A CFD code with an optimized parallel communications layer has been automatically differentiated by letting the AD tool handle the communications layer in an automated way. In adjoint mode the inversion of the communications during the backward sweep was found to produce correct code which could execute in 15 times the primal code execution time. The computational overhead is to a large extent the consequence of having to resort to binomial checkpointing to trade storage for computational time in order to invert a temporal integration loop with a number of iterations of the order of 10 6 . We have presented a detailed outline of the code modifications required to achieve the correct differentiation of the parallel code. Two flows were solved with the CFD code, an inviscid and a viscous test case. The latter is a physically dissipative system, which has been computed using the backward mode of AD without running into stability issues and yielding the correct derivative at the end of the computation. Both test cases exhibited run times for the tangent-differentiated codes which were in the range 1.6-1.7 times slower than a single primal code run. They are therefore readily superior to finite difference approximations even for single derivative computations. A natural further step would involve embedding the derivative solver into an optimal control loop. The strength of a code such as JAGUAR lies in its ability to handle acoustics problems, such as the noise radiated by the wake of an object during a given time. Optimization in this type of time-dependent and multi-parameter applications is the subject of ongoing work.

Figure 3 .

 3 Figure 3. Distribution of the Mach number around a NACA 0012 airfoil section at α = 4 • , computed with JAGUAR in inviscid two-dimensional mode. The upstream Mach number is M a = 0.5, the flow is from left to right.

Figure 4 .

 4 Figure 4. Breakdown of the most computationally-expensive subroutine in the code, ComputeRhsNavier.

Figure 5 .

 5 Figure5. Sensitivity of the lift coefficient Cl to a change in incidence angle α around a NACA 0012 airfoil at zero incidence. Two Mach numbers considered, sensitivities computed with FD and JAGUAR differentiated in tangent-mode AD. Values are compared with the curve fit to experimental data from[START_REF] Mccroskey | Technical evaluation report on the fluid dynamics panel symposium on applications of computational fluid dynamics in aeronautics[END_REF], and with the solution found using FD with the panel code XFOIL (potential flow). Time t is in code units. We verified that the agreement between the JAGUAR output at M a = 0.1 and M a = 0.5 is considerably improved if normalized by the low M a correction factor 1 -(M a) 2 .

Table 3 .

 3 Same as Table 2, but showing execution times normalized by the primal code execution time. Viscous test case, run on 16 parallel processes.

	Differentiation method Normalized compute time
	FD (MPI)	1 (×2)
	Tangent AD (AMPI)	1.7
	Adjoint AD (AMPI)	15.4

  . Upon differentiation in

	SUBROUTINE ComputeRhsNavier
	CALL E x t r a p o l S o l An d C o m p u t e F l u x
	CALL Scatter
	CALL RiemannSolver
	CALL GatherSolution
	CALL Gr ad i e n t A n dI n te r na lF l ux
	CALL ViscousFlux
	CALL GatherFlux
	CALL FluxDivAndUpdate
	END SUBROUTINE ComputeRhsNavier

Table 4 .

 4 Table 4 contains the slowdown factor for each individual adjoint subroutine found inside ComputeRhsNavier Slowdown factor between original and adjoint versions of the subroutines within ComputeRhsNavier. None of the routines above include parallel communication calls within them.

	subroutine	adjoint/primal slowdown
	ExtrapolSolAndComputeFlux	2.35
	Scatter	1.69
	RiemannSolver	8.45
	GatherSolution	2.56
	GradientAndInternalFlux	12.84
	ViscousFlux	6.44
	GatherFlux	1.73
	FluxDivAndUpdate	5.60

Acknowledgments

This work has been financed by a grant from the STAE Foundation for the 3C2T project, managed by the IRT Saint-Exupéry. J.I.C. acknowledges funding from the People Program (Marie Curie Actions) of the European Union's Seventh Framework Program (FP7/2007-2013) under REA grant agreement n. PCOFUND-GA-2013-609102, through the PRESTIGE program coordinated by Campus France. The computations for the viscous test case were carried out at the CALMIP computing center under the project P0824.


Rodrigo Plaza-Pedroche

Dimitris Georgiou

Mihalis Fakis
email: fakis@upatras.gr

Arnaud Fihey

Françoise Claudine Katan

Robin-Le Guen

Sylvain Achelle
email: sylvain.achelle@univ-rennes1.frtoc

Julian Rodríguez-López

Françoise Robin-Le Guen

Effect of protonation on the photophysical properties of 4-substituted and 4,7-disubstituted quinazoline push-pull chromophores

Keywords: fluorescence, push-pull chromophores, quinazolines, white-light emission

teaching and research institutions in France or abroad, or from public or private research centers.

Introduction

During the past decade there has been great interest in the design of push-pull azaheterocyclic chromophores due to their high tunability and the sensitivity of their photophysical properties to the environment. [1][2][3][4][5] In these structures, the nitrogen heterocycles are generally used as the electron-withdrawing part. These compounds exhibit intense positive emission solvatochromism, which is characteristic of compounds that undergo an intramolecular charge transfer (ICT) upon excitation. [6][7][8][9] These materials are also sensitive to the presence of acids, [10][11][12][13][14][15] metal cations, [16,17] and various biomolecules [18][19][20] due to the possibility of protonation, complexation, and the formation of hydrogen bonds with the nitrogen atom of the azaheterocycle, respectively. Push-pull nitrogen heterocyclic systems have also been designed for fluorescence sensing of nitroaromatic explosives. [21][22][23] Although sensitivity to acids has been used primarily for sensing applications, [24][25][26][27] a more recent application concerns white light emission. The protonation of azaheterocyclic push-pull derivatives generally leads to emission quenching. Nevertheless, in certain cases, red-shifted emission is observed with an appropriate combination of nitrogen π-deficient heterocycles and electron-donating groups. [28][29][30] Thus, when neutral and protonated forms are combined, white light can be obtained both in solution and in solid state. [31][32][33] White organic light emitting diode (WOLED) devices have been fabricated by means of this strategy. [34,35] Pyrimidinyl fragments have a stronger electron-withdrawing character than other diazinyl and pyridinyl groups due to the positions of the two nitrogen atoms. The electronwithdrawing strength can be enhanced by annelation to a phenyl ring to give a quinazoline. [1,36] Quinazoline is also a stronger base than pyrimidine (pK a ∼3.3 vs ∼1.1). [START_REF] Brown | Determination of Organic Structures by Physical Methods[END_REF] The protonation of the first nitrogen atom affects the subsequent protonation of the second nitrogen atom, requiring a significantly lower pH. In fact, it has been reported that the protonation of the first nitrogen atom in pyrimidine leads to a second pK a ≈ -6.3. [28] Quinazoline chromophores have only been studied in recent years and their push-pull derivatives have mainly been based on quinazolin-2-yl and quinazolin-4-yl fragments. [35,[START_REF] Nosova | [END_REF][39][40][41][42][43] In particular, some of us have described a set of amino-substituted aryl-, styryl-, and arylethynylquinazolines. [44] It was found that all of these compounds exhibit emission quenching upon protonation.

In the work reported here, we designed a series of six 4-substituted and 4,7disubstituted quinazoline push-pull chromophores with carbazolyl and methoxynaphthyl groups (Scheme 1). These substituents were selected because they revealed efficient white light emission upon controlled protonation. [31,32] To the best of our knowledge, these are the first examples of D-π-A-π-D chromophores with a 4,7-diarylquinazoline central core. The photophysical properties and white light emission were studied by steady-state and femtosecond to nanosecond time-resolved spectroscopy.

Results and discussion

Synthesis

Compounds 1 and 2 were obtained in moderate to good yields by Suzuki-Miyaura cross coupling of 4-chloroquinazoline and 7-bromo-4-chloroquinazoline, respectively, with the corresponding boronic acid (Scheme 1). It should be noted that the π-electron-deficient character of the quinazoline ring enabled the oxidative addition of palladium into the chloridecarbon bond with a classical ligand such as triphenylphosphine. [44][45][46][47] Scheme 1. Synthesis of compounds 1 and 2.

Electronic structures of neutral and protonated compounds

In an effort to gain insights into the electronic structure of this series of molecules and the impact of the protonation, ground state DFT calculations were carried out on the neutral and the two possible protonated forms (see Scheme 2) of the compounds. The frontier orbitals of the neutral compounds 1a and 2a are depicted in Figure 1 (see Figures S1 andS2 of the Supporting Information for 1b-2b and 1c-2c, respectively). The π frontier orbitals are spatially well separated in the 1a-1c subseries of mono-substituted molecules. The HOMO is located on the donor aryl substituent while the LUMO is on the quinazoline acceptor moiety.

The nature of the donor group has a slight impact on the HOMO-LUMO energy gap, with respective values of 4.01 eV, 3.82 eV and 4.00 eV for 1a, 1b and 1c. Scheme 2. Possible protonated forms of the compounds under study.

In the cases of 2a-2c, where two identical substituents are attached, the HOMO is now split into HOMO and HOMO-1, which are located on either one or the other donor moiety (see Figure 1 for compound 2a). The energy difference between the two occupied levels is non-negligible (see Table S1 in the Supporting Information), thus transcribing the nonsymmetric character of the disubstituted compounds. Nevertheless, upon addition of a second substituent, the electronic structure of the compounds did not markedly change and the HOMO-LUMO energy gap is only slightly reduced: e.g., from 4.01 eV for 1a to 3.96 eV for 2a (all electronic gaps are given in Table S1 of the Supporting Information). Protonation of the quinazoline unit can be achieved on two different nitrogen atoms, as depicted in Scheme 2. The protonation of position 3 appears a priori less favorable due to steric hindrance as the proton in this case is close to the aryl donor group, while such an effect is absent for protonation on position 1. This difference in steric hindrance does not consistently impact the computed ground-state structures. For instance, within the series of compounds the dihedral angle between the quinazoline and the aryl donor group varies in the range 35-45° without any clear trend in terms of the protonation site. The free energy differences between the two protonation sites for each compound are listed in Table 1. It appears that sites 1 and 3 are in most cases very close in energy, i.e., within 2 kcal mol -1 , although protonation on site 1 leads in all cases to the most stable isomer. Upon addition of a second substituent, the population ratio of site 3 increases up to 38% for 2b. Such ratios are of course dependent on the computational level of theory and definitive quantitative predictions are difficult to make for such small energy differences. For the sake of comparison, the energy differences obtained with a range-separated hybrid functional are also provided in Table S2 of the Supporting Information. Although discrepancies in values are observed, similar trends arise and this indicates that site 1 is always preferred, while the population of site 3 remains non-negligible. These findings are consistent with a very recent report that the stabilities of two experimentally observed protonation isomers is indistinguishable based both on similar DFT and wave-function calculations. [48] Table 1. Computed free energy differences in kcal mol -1 between the two protonated forms (H + (1)/H + (3)) of 1a-1c and 2a-2c, in CH 2 Cl 2 (PBE0/6-311+G(d,p)). The energy of the most stable form is set to zero and the Boltzmann population is indicated in parenthesis. 3). This difference between the electronic structures of neutral and protonated dyes is expected to yield distinguishable spectroscopic behavior.

Compd

Steady state spectroscopy in solution

The UV-vis and photoluminescence (PL) spectroscopic data for compounds 1 and 2, recorded in CH 2 Cl 2 at room temperature, are summarized in Table 2. As an example, the normalized spectra of compounds 1 are presented in Figure 2 (see Figure S3 in the Supporting Information for compounds 2). All of the compounds absorbed light in the UV region and emitted light in the blue-green region. For the monosubstituted compounds 1, the absorption maxima increased in the order λ abs (1a) < λ abs (1b) < λ abs (1c). In terms of emission, the 4-(carbazol-9-yl)phenyl derivative 1b was the most red-shifted and this led to a particularly high Stokes shift of 9205 cm -1 . The same trends were observed for the di-substituted quinazolines 2. Chromophores 2 exhibited similar or slightly red-shifted absorption and emission maxima with respect to their monosubstituted analogs 1, with a two-fold enhancement of the molar extinction coefficient. Regarding the fluorescence quantum yield, the disubstituted methoxynaphthyl quinazoline 2a was significantly more emissive (Φ F = 0.37) than the monosubstituted analog 1a (Φ F = 0.10). However, mono-and disubstituted carbazolyl derivatives 1b/2b and 1c/2c showed similar quantum yields (Φ F = 0.65-0.77). The results of the solvatochromic behavior in a series of aprotic solvents are summarized in Table 3. The PL spectra and the color changes observed upon UV irradiation for compound 2b are shown in Figure 3 (see Figures S4-S8 in the Supporting Information for all compounds). As expected for push-pull derivatives, positive emission solvatochromism was observed in all cases. This phenomenon is due to the stabilization of a highly polar excited state in polar solvents. [49,50] Nevertheless, the emission solvatochromic range is relatively limited, which is also a typical feature of chromophores with this kind of πconjugated bridge and moderately strong electron-donating groups. [8,9] Table 3. Emission solvatochromism of compounds 1 and 2 in various aprotic solvents. (30) Dimroth-Reichardt polarity parameter in kcal mol -1 . [51] Figure 3. Normalized emission spectra and fluorescence color changes experienced by 2b in different aprotic solvents. Pictures were taken in the dark upon irradiation with a hand-held UV lamp (λ exc = 365 nm, 24 W).

Compd

The photophysical properties of compounds 1 and 2 were also studied in acidic conditions in a 10 -2 M solution of camphorsulfonic acid (CSA) in CH 2 Cl 2 . The results are summarized in Table 4. The UV-vis and PL spectra of compounds 1 are shown in Figure 4 (see Figure S9 in the Supporting Information for compounds 2). As one would expect, in all cases red-shifted absorption and emission spectra were observed with respect to neutral conditions. This observation is consistent with protonation of the quinazoline ring, which reinforces its electron-withdrawing ability and enhances the ICT. On the other hand, the emission was partially or completely quenched in almost all cases except for compound 1a, for which the fluorescence quantum yield increased upon protonation (from 0.10 to 0.26). The addition of CSA to a CH 2 Cl 2 solution of 1a led to the progressive attenuation of the absorption band at 335 nm upon increasing the concentration of acid, whereas a new redshifted band corresponding to the protonated species appeared at 415 nm. The spectra showed an isosbestic point at 359 nm and this is characteristic of an equilibrium between two species (Figure 5, left). Furthermore, a progressive color change from colorless to pale yellow was observed with the naked eye (Figure 6a). In terms of emission, a new broad band at 556 nm gradually replaced that of the neutral species at 443 nm, with an isoemissive point at 490 nm (Figure 5, right). Under UV irradiation, the neutral solution of 1a exhibited blue luminescence, whereas the solution of the protonated form of this compound showed a greenyellow emission. The controlled addition of three equivalents of CSA gave CIE coordinates (0.28, 0.33) close to those of pure white light (0.33, 0.33) under excitation at 360 nm (Figures 6b and6c, Table 5). Similar behavior was observed for 1c, 2a, and 2c. Thus, white emission could be observed when neutral and protonated forms of complementary colors were present in the appropriate ratio. In contrast, the protonation of 1b and 2b resulted in a progressive . c 3 equivalents of CSA (λ exc = 360 nm). d 16 equivalents of CSA (λ exc = 390 nm). e 15 equivalents of CSA (λ exc = 380 nm). f 5 equivalents of CSA (λ exc = 400 nm).

In all of the compounds reported here, except for 1b and 2b, multicomponent fluorescence spectra with distinct but also overlapping contributions from the neutral and protonated species were clearly observed when CSA was added to the initial CH 2 Cl 2 solutions. In addition to conventional steady-state fluorescence spectroscopy, synchronous fluorescence spectroscopy (SFS) is a valuable tool to analyze and separate the contributions in multicomponent spectra due to band narrowing, thus improving analytical selectivity. In our case, SFS was applied to solutions of 1a, 1c, 2a, and 2c after addition of CSA in order to separate clearly the contributions from the neutral and protonated molecules. The corresponding results are shown in Figure S22 (Supporting Information) taken with an offset between the excitation and detection wavelength of 20 nm. After observation of the SFS spectra, two clear bands can be observed, one at 350-400 nm, attributed to the neutral molecules, and one at 560-620 nm due to the protonated ones. The bands are clearly well separated and better resolved than in the fluorescence spectra.

The 2D fluorescence spectra of 1a, 1c, 2a, and 2c with defined amounts of CSA are shown in Figure S23 (Supporting Information) and it is clear that for 1c the contribution of the protonated species is small. Nevertheless, excitation of compounds 1a, 2a, and 2c at 360-380 nm led to an emission that covered almost the whole visible spectrum. However, excitation at wavelengths longer than 400 nm only led to a single emission band, which is attributed to the protonated species.

Protonation study by 1 H NMR spectroscopy

Protonation of compound 1b was also studied by 1 H NMR spectroscopy (Figure S24).

The gradual addition of trifluoroacetic acid (TFA) to a CDCl 3 solution of 1b resulted in a progressive downfield shift of all signals, especially those belonging to the quinazoline ring.

After the addition of 40 equivalents of TFA the quinazoline signals were shifted by 0.21-0.45 ppm. As one would expect, the positions of the remaining signals were affected to a lesser extent. The spectrum remained unaltered with higher amounts of acid (up to 300 equivalents).

The absence of two sets of signals for mixtures of neutral and protonated 1b indicates a fast proton exchange in solution.

Time resolved spectroscopy in solution

The changes in the excited state dynamics of the compounds in series 1 and 2 were studied on the fs-ps and ns timescale. The dynamics were detected at the main fluorescence band of the neutral species as well as at the fluorescence band of the protonated molecules upon increasing the amount of acid. The initial fluorescence dynamics at the main band, i.e., within the first 10 ps, are shown in Figure 7 for 1a-1c, while the corresponding results for 2a-2c are presented in Figure S25 (Supporting Information). In all cases, a rapid decrease of the fluorescence intensity, which mostly took place on the < 1 ps timescale, was observed when the amount of CSA exceeded a certain value, which was characteristic for each chromophore.

The amplitude of this ultrafast quenching mechanism increased with the amount of acid. For example, in the case of 1a (Figure 7a), after addition of nine equivalents of CSA the dynamics were governed by a ~ 50 fs decay followed by a 500 fs with corresponding amplitudes of 75 and 12%, respectively, thus revealing dynamic quenching of the fluorescence of the neutral molecules due to the addition of CSA. Upon addition of four equivalents of CSA, similar decay times were found but with smaller/larger amplitudes of the ultrafast/fast component of 28 and 16%, respectively. It is interesting that in 1b, with 20 equivalents of CSA, the rapid decrease of the fluorescence intensity due to the quenching upon protonation was followed by a slight increase, which was also observed in the dynamics without acid, and this can be attributed to solvation. However, the dynamics of the protonated molecules did not change upon addition of CSA (Figure S26, Supporting Information). Apart from the quenching within the first few ps, the ns fluorescence dynamics were also examined in order to observe the change in the excited state lifetime upon addition of CSA. The decays were detected at the fluorescence bands of both the neutral and protonated species. The decays for the compounds in series 1 detected at the fluorescence band of the neutral molecules are shown in Figure 8 and the corresponding results for series 2 are shown in Figure S27 (Supporting Information). In general, the decays were fitted by multiexponential functions and the average lifetimes of the neutral chromophores decreased either slightly (1a, 1b, 2b, 2c) or significantly (1c, 2a) upon addition of acid due to the emergence of non-radiative channels and the decrease of the amplitude of the main population decay lifetime. The fitting parameters are given in Tables S3-S8 (Supporting Information). As an example, 1c exhibited a single-exponential decay in CH 2 Cl 2 with a 3.9 ns lifetime (Figure 8c).

The decays became faster upon increasing the amount of CSA, but when the amount of CSA exceeded 19 equivalents a very short mechanism (< 0.02 ns, i.e., smaller than the instrument response function of the nanosecond time-resolved system) dominated the decay. This short mechanism was better revealed in the fs-ps measurements (Figure 7). The decays regarding the emission band of the protonated species, namely at 560-620 nm, are presented in Figure S28 and the corresponding fitting parameters are summarized in Tables S9-S12 of the Supporting Information. Once again, multiexponential functions were used to fit the decays better, while the average lifetimes of the protonated molecules ranged between 1.3 and 3.5 ns and these were unaffected by increasing the amount of CSA.

Photophysical properties in thin film

Simple thin films of polystyrene doped with 1 wt% of the quinazoline derivatives 1a, 2a, and 2c were prepared by spray deposition on glass substrates. Films were prepared from both neutral and fully protonated forms and these exhibited a significant blue-shifted emission with regard to their emissions in solution (Table 6), a phenomenon that was generally observed with similar azaheterocyclic push-pull derivatives. [31][32][33] This blue shift resulted in a mixture of two non-complementary colors and prevented the emission of white light by partial protonation of 1a (Table 6, Figure S29 in the Supporting Information). Nevertheless, the addition of 0.85 and 0.5 equivalents of CSA to the solutions of 2a and 2c used for spray deposition, respectively, resulted in films that showed white photoluminescence when irradiated at 365 nm, with chromaticity coordinates close to those of pure white (Table 6, Figures 10 andS30). In order to examine better the white light emission from 2c, the nanosecond dynamics for a film of 2c with 0.5 equivalents of CSA (detected at both emission bands) were studied upon high-energy excitation at 400 nm (Figure 9c). The decays at 430 nm showed a rapid decrease of the intensity, while at 600 nm a slow increase was observed, which indicates an energy transfer process between neutral and protonated species. Such an energy transfer has been recognized in the past as the working mechanism in white OLEDs based on partial protonation. [35] The existence of an energy transfer is also supported by the detection of the decay at 600 nm upon lower energy excitation at 470 nm, i.e., upon selective excitation at the absorption band of the protonated species. It is clear that the increase in the dynamics, which is characteristic of the energy transfer, is absent (Figure 9c).

Conclusions

A new series of push-pull 4-substituted and 4,7-disubstituted quinazolines has been prepared efficiently by Suzuki-Miyaura reactions. The compounds were fully characterized using a variety of techniques. Carbazolyl and methoxynaphthyl groups were incorporated as electron-donating groups. Optical studies revealed that all of the compounds absorb light in the UV region and emit blue-green light upon irradiation, with large Stokes shifts observed.

The positive emission solvatochromism confirmed the formation of an intramolecular chargeseparated emitting state. The molecules can be easily protonated on the heterocyclic ring.

Protonation of compounds 1b and 2b was accompanied by a quenching of the fluorescence, whereas compounds 1a, 1c, 2a, and 2c remained emissive and the addition of acid led to the appearance of a new red-shifted band in the fluorescence spectra. The controlled partial protonation resulted in multicolor photoluminescence, including white light, both in solution and in solid state. DFT calculations indicate that the protonation occurs preferentially on the nitrogen at position 1 even if the population of monoprotonated species at position 3 is not negligible. HOMO-LUMO energy gaps are affected very little by the addition of a second substituent but are significantly decreased by protonation. The changes in the excited state dynamics were studied by time resolved spectroscopy, with dynamic quenching of the fluorescence band of the neutral species observed upon protonation within a few tens of fs.

Experimental part

General information

All solvents were reagent grade for synthesis and spectroscopic grade for photophysical measurements. 4-Chloroquinazoline and 7-bromo-4-chloroquinazoline were purchased from Accela and the boronic acids were purchased from Sigma-Aldrich or TCI and were used without further purification. NMR spectra were recorded in CDCl 3 on a Bruker Avance Neo 500 spectrometer. The chemical shifts δ are reported in ppm and are referenced to the residual protons of the deuterated solvent or carbon nuclei ( 1 H, δ = 7.27 ppm; 13 C, δ = 77.0 ppm). The coupling constants J are given in Hz. In the 1 H NMR spectra, the following abbreviations are used to describe the peak patterns: s (singlet), d (doublet), t (triplet), q (quadruplet), m (multiplet). In the 13 C NMR spectra, the nature of the carbons (C, CH, CH 2 or CH 3 ) was determined by performing a DEPT experiment. Acidic impurities in CDCl 3 were removed by treatment with solid K 2 CO 3 . Melting points (°C) were measured on a Büchi M-565 apparatus and are uncorrected. MALDI-TOF mass spectra were obtained on a Bruker Autoflex II spectrometer (no matrix was needed). High-resolution mass analyses were carried out at the 'Centre Régional de Mesures Physiques de l'Ouest' (CRMPO, Université de Rennes 1) using a Bruker MicroTOF-Q II instrument. UV-visible and fluorescence spectroscopy studies in solution were conducted on a Jasco V-750 spectrophotometer and Jasco FP-8300 or Spex Fluoromax-3 Jobin-Yvon Horiba spectrofluorimeters, respectively. All solutions were measured with optical densities below 0.1. Fluorescence quantum yields (±10%) were determined relative to the indicated reference. Thin films were prepared by the direct nebulization of CH 2 Cl 2 solutions of polystyrene doped with the appropriate compound (1 wt%, in the absence and the presence of CSA) on various heated glass substrates through a fine spray nozzle powered by an air compressor system. The fluorescence spectra of these films were recorded on a Jasco FP-8300 spectrofluorimeter at λ exc = 365 nm. The fluorescence dynamics on the fs-ps timescale were measured by a femtosecond timeresolved fluorescence method based on the upconversion technique. [52,53] The dynamics were measured under magic angle conditions and the samples were excited at 385 nm, which corresponds to the second harmonic of a Ti:Sapphire fs laser emitting 80 fs pulses at 770 nm. The samples were placed in a 1 mm path-length specific cell that was continuously rotated, and had an optical density below 0.1 at the excitation wavelength. The instrument response function (IRF) was ~ 250 fs. The fluorescence decays on the ns timescale were detected by means of the Time Correlated Single Photon Counting technique using either a 400 nm or 470 nm diode laser with an 80 ps pulse duration as the excitation source. The IRF of the ns time-resolved technique was ~ 100 ps. [54]

Computational details

All calculations were performed with the Gaussian16 code. [55] Geometry optimizations for the different compounds were followed by frequency calculations to ensure the true nature of the energy minimum, at the PBE0 [56] /6-311+G(d,p) level, and the solvent effects were included trough the Polarizable Continuum Model (PCM). [57] A similar protocol using the CAM-B3LYP [58] range-separated functional was also applied for additional data presented in the Supporting Information.

General procedure for Suzuki-Miyaura cross-coupling reactions

A mixture of 4-chloroquinazoline or 7-bromo-4-chloroquinazoline (1 mmol), the appropriate boronic acid (1.1 or 2.2 mmol, respectively), Pd(AcO) 2 (5 mol%), PPh 3 (10 mol%), aqueous Na 2 CO 3 (5 mmol, dissolved in the minimum amount of water), and glyme (5 mL) was degassed by bubbling Ar through for 10 min. The reaction mixture was stirred in a pressure tube at the indicated temperature (100-140 ºC) for 22-23 h. After removing the glyme under reduced pressure, the reaction mixture was diluted with water and extracted with CH 2 Cl 2 (×3). The combined organic layers were dried (MgSO 4 ), filtered through a short pad of Celite, and concentrated under vacuum. The crude product was purified by flash chromatography on neutral alumina (eluent, mixtures of hexanes/EtAcO of increasing polarity and a few drops of Et 3 N) and/or washing with the indicated solvent.

4-[(9-Ethylcarbazol-3-yl)]quinazoline (1c).

Prepared from 4-chloroquinazoline (100 mg, 0.61 mmol), 9-ethylcarbazole-3-boronic acid (160 mg, 0.67 mmol), Pd(AcO) 2 (7 mg, 0.031 mmol), PPh 3 (16 mg, 0.061 mmol), aqueous Na 2 CO 3 (323 mg, 3.05 mmol, dissolved in the minimum amount of water), and glyme (3 mL). The mixture was heated at 130 ºC for 22 h. Purification by flash chromatography and washing with boiling hexanes gave the title compound as a pale yellow solid. Yield: 90 mg (46%). Mp 125.5-126.5 ºC. 1 H NMR (CDCl 3 , 500 MHz): δ 1.52 (t, 3H, 3 J = 7.5 Hz, CH 3 ), 4.48 (q, 2H, 3 J = 7.5 Hz, CH 2 ), 7.30 (ddd, 1H,

Figure 1 .

 1 Figure 1. Frontier molecular orbitals (isovalue: 0.025) for neutral and protonated compounds 1a and 2a (PBE0/6-311+G(d,p), CH 2 Cl 2 ).

Figure 2 .

 2 Figure 2. Normalized absorption (solid lines) and emission (dashed lines) spectra of compounds 1a (black), 1b (red), and 1c (blue) in CH 2 Cl 2 solution. Excitation performed at absorption maxima.

Figure 4 .

 4 Figure 4. Normalized absorption (solid lines) and emission (dashed lines) spectra of compounds 1a (black), 1b (red), and 1c (blue) in a 10 -2 M solution of CSA (large excess) in CH 2 Cl 2 . Excitation performed at absorption maxima.

  extinction of the emission (see Figures S11-S15 and S17-S21 in the Supporting Information for all compounds).

Figure 5 .

 5 Figure 5. Changes in the absorption (left) and emission (right, λ exc = 360 nm) spectra of a CH 2 Cl 2 solution of 1a upon addition of CSA.

Figure 6 .

 6 Figure 6. Changes in the color of a CH 2 Cl 2 solution of 1a (c = 3.0 × 10 -5 M) after the addition of 3 (middle) and 100 equivalents of CSA (right): a) under visible light; b) under a hand-held UV lamp (365 nm, 24 W). c) Chromaticity of the fluorescence colors in a 1931 CIE diagram (λ exc = 360 nm).

Figure 7 .

 7 Figure 7. Fluorescence dynamics on the 10 ps timescale for (a) 1a, (b) 1b, and (c) 1c upon addition of various amounts of CSA as shown in the figures. The dynamics were detected at the peak of the main fluorescence band, λ exc = 385 nm.

Figure 8 .

 8 Figure 8. Fluorescence decays on the ns timescale for (a) 1a, (b) 1b, and (c) 1c upon addition of various amounts of CSA as shown in the figures. The dynamics were detected at the peak of the main fluorescence band, λ exc = 400 nm.

Figure 9 .

 9 Figure 9. (a) Fluorescence spectra (λ exc = 365 nm) and (b) colors of polystyrene thin films doped with 2c (1 wt%) in the absence and the presence of 0.5 and 100 equivalents of CSA (from left to right). Photographs were taken in the dark upon irradiation with a hand-held UV lamp (λ exc = 365 nm, 24 W). Also in (b) chromaticity of the fluorescence colors in a 1931 CIE diagram. (c) Fluorescence decays on the ns timescale for a film of 2c in PS with 0.5 equivalents of CSA, detected at the two emission bands upon excitation at 400 nm and 470 nm.

4-( 6 - 1 (

 61 Methoxynaphthalen-2-yl)quinazoline (1a). Prepared from 4-chloroquinazoline (200 mg, 1.22 mmol), 6-methoxy-2-naphthaleneboronic acid (270 mg, 1.34 mmol), Pd(AcO) 2 (14 mg, 0.062 mmol), PPh 3 (32 mg, 0.122 mmol), aqueous Na 2 CO 3 (646 mg, 6.1 mmol, dissolved in the minimum amount of water), and glyme (6 mL). The mixture was heated at 100 ºC for 22 h. Purification by flash chromatography and washing with MeOH gave the title compound as a colorless solid. Yield: 190 mg (55%). Mp 135-136 ºC (EtAcO/MeOH).1 H NMR (CDCl 3 , 500 MHz): δ 3.99 (s, 3H, OCH 3 ), 7.25-7.27 (m, 2H), 7.64 (ddd, 1H, 4 J = 1.0 Hz, 3 J = 7.0 Hz, 3 J = 8.5 Hz), 7.87-7.91 (m, 2H), 7.93-7.96 (m, 2H), 8.15 (d, 1H, 3 J = 8.5 Hz), 8.24-8.26 (m, 2H), 9.42 (s, 1H, H2). 13 C NMR and DEPT (CDCl 3 , 125 MHz): δ 168.4 (C), 158.9 (C), 154.7 (CH), 151.2 (C), 135.4 (C), 133.6 (CH), 132.3 (C), 130.3 (CH), 130.CH), 128.9 (CH), 128.4 (C), 127.7 (CH), 127.5 (CH), 127.3 (CH), 123.3 (C), 119.7 (CH), 105.7 (CH), 55.4 (CH 3 ). MALDI-TOF MS (no matrix): m/z 287.3 [M + H] + . HRMS (ESI/ASAP, TOF): m/z calculated for C 19 H 15 N 2 O [M + H] + 287.1179; found 287.1177. 4-[4-(Carbazol-9-yl)phenyl]quinazoline (1b). Prepared from 4-chloroquinazoline (200 mg, 1.22 mmol), 4-(9H-carbazol-9-yl)phenylboronic acid (368 mg, 1.28 mmol), Pd(AcO) 2 (14 mg, 0.062 mmol), PPh 3 (32 mg, 0.122 mmol), aqueous Na 2 CO 3 (646 mg, 6.1 mmol, dissolved in the minimum amount of water), and glyme (6 mL). The mixture was heated at 130 ºC for 23 h. Purification by flash chromatography and washing with MeOH gave the title compound as a colorless solid. Yield: 210 mg (46%). Mp 195-197 ºC (EtAcO/MeOH). 1 H NMR (CDCl 3 , 500 MHz): δ 7.35 (ddd, 2H, 4 J = 1.0 Hz, 3 J = 7.0 Hz, 3 J = 8.0 Hz), 7.47 (ddd, 2H, 4 J = 1.0 Hz, 3 J = 7.5 Hz, 3 J = 8.5 Hz), 7.58 (d, 2H, 3 J = 8.0 Hz), 7.73 (ddd, 1H, 4 J = 1.0 Hz, 3 J = 7.0 Hz, 3 J = 8.0 Hz), 7.84 (d, 2H, 3 J = 8.5 Hz), 8.00 (ddd, 1H, 4 J = 1.0 Hz, 3 J = 7.5 Hz, 3 J = 8.5 Hz), 8.08 (d, 2H, 3 J = 8.5 Hz), 8.19 (d, 2H, 3 J = 8.0 Hz), 8.20 (d, 1H, 3 J = 8.0 Hz), 8.31 (d, 2H, 3 J = 8.5 Hz), 9.46 (s, 1H, H2). 13 C NMR and DEPT (CDCl 3 , 125 MHz): δ 167.4 (C), 154.7 (CH), 151.3 (C), 140.5 (C), 139.6 (C), 135.9 (C), 133.9 (CH), 131.6 (CH), 129.1 (CH), 128.0 (CH), 127.0 (CH), 126.8 (CH), 126.1 (CH), 123.7 (C), 123.1 (C), 120.4 (CH), 120.4 (CH), 109.8 (CH). MALDI-TOF MS (no matrix): m/z 372.3 [M + H] + . HRMS (ESI/ASAP, TOF): m/z calculated for C 26 H 18 N 3 [M + H] + 372.1495; found 372.1499.

4 J 7 ( 7 ( 7 ( 9 ( 2 ×

 477792 = 1.0 Hz, 3 J = 8.0 Hz, 3 J = 9.0 Hz), 7.50 (d, 1H, 3 J = 8.5 Hz), 7.53-7.56 (m, 1H), 7.61 (d, 1H, 3 J = 8.5 Hz), 7.65 (ddd, 1H, 4 J = 1.0 Hz, 3 J = 6.5 Hz, 3 J = 8.0 Hz), 7.94 (ddd, 1H, 4 J = 1.5 Hz, 3 J = 7.0 Hz, 3 J = 8.5 Hz), 7.98 (dd, 1H, 4 J = 1.0 Hz, 3 J = 8.5 Hz), 8.15 (d, 1H, 3 J = 8.5 Hz), 8.18 (d, 1H, 3 J = 8.0 Hz), 8.34 (dd, 1H, 4 J = 0.5 Hz, 3 J = 8.5 Hz), 8.61 (dd, 1H, 4 J = 0.5 Hz, 3 J = 1.5 Hz), 9.41 (s, 1H, H2).13 C NMR and DEPT (CDCl 3 , 125 MHz): δ 169.0 (C), 154.CH), 151.3 (C), 141.0 (C), 140.5 (C), 133.4 (CH), 128.8 (CH), 127.9 (CH), 127.7 (C), 127.CH), 127.5 (CH), 126.3 (CH), 123.5 (C), 123.2 (C), 123.0 (C), 122.9 (CH), 120.8 (CH), 119.5 (CH), 108.9 (CH), 108.6 (CH), 37.8 (CH 2 ), 13.8 (CH 3 ). MALDI-TOF MS (no matrix): m/z 324.3 [M + H] + . HRMS (ESI/ASAP, TOF): m/z calculated for C 22 H 18 N 3 [M + H] + 324.1495; found 324.1496. 4,7-Bis(6-methoxynaphthalen-2-yl)quinazoline (2a). Prepared from 7-bromo-4chloroquinazoline (100 mg, 0.41 mmol), 6-methoxy-2-naphthaleneboronic acid (182 mg, 0.902 mmol), Pd(AcO) 2 (5 mg, 0.02 mmol), PPh 3 (11 mg, 0.04 mmol), aqueous Na 2 CO 3 (217 mg, 2.05 mmol, dissolved in the minimum amount of water), and glyme (3 mL). The mixture was heated at 120 ºC for 22 h. Purification by flash chromatography and washing with MeOH gave the title compound as a colorless solid. Yield: 90 mg (50%). Mp 231-233 ºC (CHCl 3 /MeOH). 1 H NMR (CDCl 3 , 500 MHz): δ 3.97 (s, 3H, OCH 3 ), 4.00 (s, 3H, OCH 3 ), 7.21-7.28 (m, 2H), 7.86 (d, 1H, 3 J = 9.0 Hz), 7.89-7.98 (m, 4H), 7.93-7.96 (m, 2H), 8.02 (dd, 1H, 4 J = 2.0 Hz, 3 J = 9.0 Hz), 8.19 (s, 1H), 8.28 (s, 1H), 8.32 (d, 1H, 3 J = 9.0 Hz), 8.44 (d, 1H, 4 J = 2.0 Hz), 9.43 (s, 1H, H2). 13 C NMR and DEPT (CDCl 3 , 125 MHz): δ 168.0 (C), 158.9 (C), 158.4 (C), 155.2 (CH), 151.8 (C), 146.2 (C), 135.4 (C), 134.6 (C), 134.3 (C), 132.3 (C), 130.3 (CH), 130.1 (CH), 130.0 (CH), 129.1 (C), 128.4 (C), 127.8 (CH), 127.7 (CH), 127.5 (CH), 127.3 (CH), 127.3 (CH), 126.8 (CH), 126.1 (CH), 125.6 (CH), 122.2 (C), 119.CH), 119.6 (CH), 105.7 (CH), 105.6 (CH), 55.4 (CH 3 ), 55.4 (CH 3 ). MALDI-TOF MS (no matrix): m/z 443.3 [M + H] + . HRMS (ESI/ASAP, TOF): m/z calculated for C 30 H 23 N 2 O 2 [M + H] + 443.1754; found 443.1756. 4,7-Bis[4-(carbazol-9-yl)phenyl]quinazoline (2b). Prepared from 7-bromo-4chloroquinazoline (100 mg, 0.41 mmol), 4-(9H-carbazol-9-yl)phenylboronic acid (259 mg, 0.902 mmol), Pd(AcO) 2 (5 mg, 0.02 mmol), PPh 3 (11 mg, 0.04 mmol), aqueous Na 2 CO 3 (217 mg, 2.05 mmol, dissolved in the minimum amount of water), and glyme (3 mL). The mixture was heated at 140 ºC for 22 h. Purification by washing with a boiling mixture of EtAcO/MeOH gave the title compound as a colorless solid. Yield: 160 mg (64%). Mp 261-263 ºC (EtAcO/MeOH). 1 H NMR (CDCl 3 , 500 MHz): δ 7.33-7.38 (m, 4H), 7.46-7.51 (m, 4H), 7.55 (d, 2H, 3 J = 8.5 Hz), 7.61 (d, 2H, 3 J = 8.0 Hz), 7.80 (d, 2H, 3 J = 8.5 Hz), 7.89 (d, 2H, 3 J = 8.5 Hz), 8.06 (d, 2H, 3 J = 8.5 Hz), 8.07 (dd, 1H, 4 J = 2.0 Hz, 3 J = 9.0 Hz), 8.15 (d, 2H, 3 J = 8.5 Hz), 8.20 (t, 4H, 3 J = 7.0 Hz), 8.45 (d, 1H, 3 J = 8.5 Hz), 8.51 (d, 1H, 4 J = 1.5 Hz), 9.51 (s, 1H, H2). 13 C NMR and DEPT (CDCl 3 , 125 MHz): δ 167.2 (C), 155.4 (CH), 151.8 (C), 145.6 (C), 140.6 (C), 140.5 (C), 139.8 (C), 138.5 (C), 138.0 (C), 135.9 (C), 131.7 (CH), 129.1 (CH), 127.6 (CH), 127.4 (CH), 127.1 (CH), 126.6 (CH), 126.2 (CH), 126.1 (CH), 123.7 (C), 123.6 (C), 122.2 (C), 120.5 (CH), 120.4 (CH), 120.3 (CH), 109.8 (CH). MALDI-TOF MS (no matrix): m/z 613.5 [M + H] + . HRMS (ESI/ASAP, TOF): m/z calculated for C 44 H 29 N 4 [M + H] + 613.2387; found 613.2385.4,7-Bis[(9-ethylcarbazol-3-yl)]quinazoline (2c).Prepared from 7-bromo-4chloroquinazoline (100 mg, 0.41 mmol), 9-ethylcarbazole-3-boronic acid (216 mg, 0.902 mmol), Pd(AcO) 2 (5 mg, 0.02 mmol), PPh 3 (11 mg, 0.04 mmol), aqueous Na 2 CO 3 (217 mg, 2.05 mmol, dissolved in the minimum amount of water), and glyme (3 mL). The mixture was heated at 140 ºC for 23 h. Purification by flash chromatography and washing with a boiling mixture of EtAcO/MeOH gave the title compound as a pale yellow solid. Yield: 150 mg (71%). Mp 255-258 ºC (dec.) (EtAcO/MeOH).1 H NMR (CDCl 3 , 500 MHz): δ 1.51 (t, 3H, 3 J = 7.5 Hz, CH 3 ), 1.54 (t, 3H, 3 J = 7.5 Hz, CH 3 ), 4.45 (q, 2H, 3 J = 7.5 Hz, CH 2 ), 4.49 (q, 2H, 3 J = 7.5 Hz, CH 2 ), 7.29-7.33 (m, 2H), 7.47 (d, 1H, 3 J = 8.0 Hz), 7.50-7.58 (m, 4H), 7.63 (d, 1H, 3 J = 8.5 Hz), 7.95 (dd, 1H, 4 J = 2.0 Hz, 3 J = 8.5 Hz), 8.04 (dd, 1H, 4 J = 2.0 Hz, 3 J = 8.5 Hz), 8.07 (dd, 1H, 4 J = 2.0 Hz, 3 J = 8.5 Hz), 8.21 (d, 2H, 3 J = 7.5 Hz), 8.41 (d, 1H, 3 J = 8.5 Hz), 8.45 (d, 1H, 4 J = 2.0 Hz), 8.56 (d, 1H, 4 J = 2.0 Hz), 8.67 (d, 1H, 4 J = 1.0 Hz), 9.42 (s, 1H, H2). 13 C NMR and DEPT (CDCl 3 , 125 MHz): δ 168.6 (C), 155.1 (CH), 151.9 (C), 147.0 (C), 141.0 (C), 140.5 (C), 140.5 (C), 140.2 (C), 130.1 (C), 128.1 (CH), 128.0 (C), 127.9 (CH), 127.4 (CH), 126.3 (CH), 126.2 (CH), 125.5 (CH), 125.4 (CH), 123.7 (C), 123.2 (C), 123.0 (C), 123.0 (C), 122.8 (CH), 122.0 (C), 120.8 (CH), 120.6 (CH), 119.6 (CH), 119.5 (CH), 119.3 (CH), 109.1 (CH), 108.8 (CH), 108.8 (CH), 108.6 (CH), 37.8 (CH 2 ), 37.7 (CH 2 ), 13.CH 3 ). MALDI-TOF MS (no matrix): m/z 517.3 [M + H] + . HRMS (ESI/ASAP, TOF): m/z calculated for C 36 H 29 N 4 [M + H] + 517.2387; found 517.2387.

Table 2 .

 2 UV-vis and photoluminescence (PL) data for compounds 1 and 2 in CH 2 Cl 2 solution.

	Compd a	λ abs	ε
		(nm)	(

mM -1 cm -1 ) λ em (nm) Φ F b Stokes shift (cm -1 ) τ (ns) k r (10 9 s -1 ) k nr (10 9 s -1 )

  All spectra were recorded at room temperature at c = 1.5-3.0 × 10 -5 M. b Fluorescence quantum yield (±10 %) determined relative to that of quinine sulfate in 0.1 M H 2 SO 4 (Φ F = 0.54).

	1a	335	14.0	443 0.10	7277	6.47	0.015	0.14
	1b	341	14.6	497 0.65	9205	7.26	0.089	0.048
	1c	349, 361	15.4, 14.5	454 0.77	5674	3.93	0.19	0.058
	2a	342	30.6	463 0.37	7641	3.14	0.12	0.20
	2b	342	30.3	503 0.71	9359	6.95	0.10	0.041
	2c	351, 370	30.6, 31.3	471 0.71	5796	3.38	0.21	0.086
	a

Table 4 .

 4 UV-vis and photoluminescence (PL) data for compounds 1 and 2 in acid solution (10 -2 M CSA in CH 2 Cl 2 ). All spectra were recorded at room temperature at c = 1.5-3.0 × 10 -5 M. b Fluorescence quantum yield (±10%) determined relative to fluorescein in 0.1 M NaOH (Φ F = 0.79) as standard.

	Compd a	λ abs (nm)	ε (mM -1 cm -1 )	λ em (nm)	Φ F b	Stokes shift (cm -1 )
	1a	300, 415	8.6, 19.4	556	0.26	6111
	1b	291, 323, 337, 442 31.2, 11.5, 11.6, 12.1	743	<0.01	9165
	1c	267, 292, 341, 451 27.5, 23.8, 12.1, 25.9	614	0.04	5886
	2a	273, 304, 428	46.8, 24.0, 37.0	630	0.09	7491
	2b	292, 325, 338, 450 54.4, 33.9, 32.3, 22.5	758	<0.01	9030
	2c	267, 295, 327, 469 28.9, 45.3, 22.9, 37.9	636	0.18	5599
	a

Table 5 .

 5 CIE coordinates for compounds 1 and 2 in solution. In CH 2 Cl 2 solution. b In acid solution (10 -2 M CSA in CH 2 Cl 2

			Chromaticity coordinates (x,y)
	Compd	Neutral form a	Protonated form b	Mixture of neutral and protonated forms
	1a	(0.15, 0.09)	(0.42, 0.54)	(0.28, 0.33) c
	1b	(0.21, 0.38)	--	--
	1c	(0.15, 0.10)	(0.53, 0.42)	(0.35, 0.31) d
	2a	(0.16, 0.16)	(0.55, 0.43)	(0.34, 0.32) e
	2b	(0.23, 0.43)	--	--
	2c	(0.15, 0.19)	(0.58, 0.41)	(0.33, 0.31) f
	a

Table 6 .

 6 PL data and CIE coordinates of thin films of polystyrene doped with 1 wt% of quinazolines

1a, 2a, and 2c. λ em (nm) Chromaticity coordinates (x,y) a

  exc = 365 nm in all cases. b 0.5 equivalents of CSA. c 0.85 equivalents of CSA. d 0.5 equivalents of CSA.

	Compd	Neutral form	Protonated form	Neutral form	Protonated form	Mixture of neutral and protonated forms
	1a	419	508	(0.16, 0.08) (0.26, 0.48)	(0.19, 0.32) b
	2a	416	558	(0.16, 0.05) (0.40, 0.47)	(0.26, 0.33) c
	2c	423	595	(0.16, 0.04) (0.48, 0.41)	(0.36, 0.31) d
	a λ

Acknowledgments

J. R.-L. thanks the Ministerio de Economía y Competitividad/Agencia Estatal de Investigación/FEDER for financial support (project CTQ2017-84561-P). Funding from the Junta de Comunidades de Castilla-La Mancha/FEDER is also gratefully acknowledged by J. R.-L. and S. A. (project SBPLY/17/180501/000214). DFT calculations were performed at

ISCR and the work was granted access to the HPC resources of TGCC/CINES/IDRIS under the allocation 2020-A0080800649 made by Grand Equipement National de Calcul Intensif (GENCI).