Classdesc和Graphcode:支持C++中的科学编程
Classdesc and Graphcode: support for scientific programming in C++
摘要:
面向对象的程序设计语言,如Java和Objective C,在实现基于代理和其他基于对象的模拟方面已经变得流行,因为这些语言中的对象可以{ \em reflect}(即,对对象的结构进行运行时查询)。例如,这允许编写相当简单的{ \em序列化}例程(将对象转换为可以存储或通过网络传递的二进制表示)。然而C++不提供这种能力,因为类型信息在编译时就被丢弃了。然而,C++通常是首选的开发环境,无论是出于性能方面的原因,还是因为它的表达功能(如运算符重载)。在科学编码中,随着模型的细化和对不同现象的研究,模型代码的变化不断发生。然而,传统上,诸如检查点、用于初始化模型参数的例程和模型输出的分析之类的设施依赖于保持静态的底层模型,否则每次修改模型时,都需要改变一系列支持例程以反映新的数据结构。反射提供了模拟框架无需程序员干预即可适应底层模型的优点,从而减少了修改模型的工作量。本文介绍了为C++带来对象反射的许多好处的{ \em Classdesc}系统、大大简化基于MPI的并行程序编码的{ \em ClassdescMP}和通用数据并行编程环境{ \em Graphcode}。
英文摘要:
Object-oriented programming languages such as Java and Objective C have become popular for implementing agent-based and other object-based simulations since objects in those languages can {\em reflect} (i.e. make runtime queries of an object's structure). This allows, for example, a fairly trivial {\em serialisation} routine (conversion of an object into a binary representation that can be stored or passed over a network) to be written. However C++ does not offer this ability, as type information is thrown away at compile time. Yet C++ is often a preferred development environment, whether for performance reasons or for its expressive features such as operator overloading. In scientific coding, changes to a model's codes takes place constantly, as the model is refined, and different phenomena are studied. Yet traditionally, facilities such as checkpointing, routines for initialising model parameters and analysis of model output depend on the underlying model remaining static, otherwise each time a model is modified, a whole slew of supporting routines needs to be changed to reflect the new data structures. Reflection offers the advantage of the simulation framework adapting to the underlying model without programmer intervention, reducing the effort of modifying the model. In this paper, we present the {\em Classdesc} system which brings many of the benefits of object reflection to C++, {\em ClassdescMP} which dramatically simplifies coding of MPI based parallel programs and {\em Graphcode} a general purpose data parallel programming environment.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。