ns-3 Design Overview ns-3 project http://www.nsnam.org/ feedback: ns-developers@isi.edu September 17, 2006 Introduction This ns-3 design document is intended to document the technical goals, software architecture, implementation choices, and interfaces of the simulator. It provides a place to record design agreements or archive design decisions for future reference. It is expected that this document can evolve or fork to become an “ns-3 Developers Guide” at some point in the future. This documentis written in Latex and is to be maintainedin revision control on the ns-3 code server. Changes to the document should be discussed on the ns-developers@isi.edu mailing list. Contents 1 Functional Overview 3 1.1 Goals ........................................... ............ 3 1.2 Userexperience.................................. ................ 3 1.2.1 Installation .................................. .............. 3 1.2.2 Userinterface................................. .............. 3 1.2.3 Scenariodefinition .... .... .... ... .... .... .... .. ............... 4 1.2.4 Capabilities.................................. .............. 4 1.3 Documentation ................................... ............... 4 1.4 RequirementsfromCollaborators. ...................... 4 1.4.1 VINI .......................................... ......... 5 1.4.2 Emulab........................................ .......... 5 1.4.3 NetworkSimulationCradle . ................ 5 1.4.4 Largescalesimulations. ................. 5 2 Technical Overview 6 2.1 Basics.......................................... ............. 6 2.2 High-levelarchitecture . .................... 7 2.3 Sourcecodeorganization . ................... 8 2.4 Buildenvironment ................................ ................ 8 2.4.1 SConsoverview ................................. ............ 9 2.4.2 Options....................................... ........... 9 2.4.3 Buildtargets .................................. ............. 9 2.4.4 Buildoutput ................................... ............ 10 3 ns-3 Coding Standard 11 3.1 Introduction.................................... ................ 11 3.2 Recommendations................................. ................ 11 3.2.1 naming ........................................ .......... 11 3.2.2 Memorymanagement .............................. ............ 12 3.2.3 Templates..................................... ............ 12 3.3 Standards ....................................... .............. 12 3.3.1 General....................................... ........... 12 3.3.2 Commenting .................................... ........... 13 3.3.3 NamingConventions. .............. 14 3.3.4 StatementFormatting. ................ 15 3.3.5 HeaderFiles ................................... ............ 17 3.3.6 SourceCodeFiles ............................... ............. 18 3.3.7 Backwardcompatibilityofbugfixes . ................... 19 1 4 ns-3 core 20 4.1 Simulator,Scheduler,andEvents . ...................... 21 4.1.1 Simulator..................................... ............ 21 4.1.2 Scheduler..................................... ............ 21 4.1.3 Events........................................ ........... 22 4.2 Timers.......................................... ............. 23 4.3 Time............................................ ............ 23 4.4 Callbacks ....................................... .............. 23 4.5 Referencelistimplementation . ..................... 24 4.6 FileI/Oandsystemtime . .... .... .... ... .... .... .... ................. 24 5 Running ns-3 simulations 25 5.1 Executingsimulations. ................... 25 5.1.1 main()program................................. ............. 25 5.1.2 Scriptinginterface . ................ 27 6 Packets 28 7 Tracing and Logging 29 7.1 Requirements .................................... ............... 29 7.1.1 traceformatforTraceGraphsupport . .................... 30 8 Acknowledgments 32 2 Chapter 1 Functional Overview This chapter describes the ns-3 simulator from a functional or user’s perspective; i.e., without as much regard to internal implementation. 1.1 Goals This section describes the broad goals for ns-3. • ns-3 is a discrete-event networking simulator, written in C++, with an emphasis on layers 2-4 of the OSI stack, including IPv4, IPv6, and future next-generation (non-IP) networks. • ns-3 is oriented towards supporting networking research and education via simulation. • ns-3 is free software developed using a community-oriented, open source development process, under GNU GPLv2 compatible licensing. 1.2 User experience 1.2.1 Installation ns-3 should be buildable from source or binary formats on popular desktop and server platforms, including x86, x86-64, and ppc, and the Linux, OS X (Darwin), Windows (32-bit, build environment TBD), Solaris, and BSD (FreeBSD and others) operating systems. 1.2.2 User interface • ns-3 should continue to offer text/script-based (non-GUI) configuration. It should be possible to create GUI-based configurators, but such configurators are outside the scope of the ns-3 project. • ns-3 should output trace (including pcap), log, statistics, and animation files 3 – trace and log files should be convertible to the existing nam format, via some external scripting technique, for backward compatibility. • Open issue: should ns-3 be directly integrated with an animator or should the animator just run on output files (post-process)? 1.2.3 Scenario definition Users use the simulator by first defining a simulation scenario, compiling the scenario if necessary, executing the simulation scenario, and processing the simulation output, either visually through an animator, or through other handling of the output files generated. Often, users of the simulator will directly modify the simulator source code as a starting point. • ns-3 scenarios can be written in C++ (as a main() function), with selected configuration options exposed as command- line arguments • ns-3 should provide a scripting environment or interface – full backward compatibility with ns-2 scripts is a non-goal – Open issue: Selection of scripting language(s) is TBD. Preferred option presently is python and possibly SWIG bindings. • scenario execution is visible on a console standard output, or written to a log file. • support for some stock topology constructs should be provided 1.2.4 Capabilities • ns-3 shall provide an emulation capability– ability to source/sink real packets and execute in real-time • ns-3 shall be designed to scale for parallel processor support and distributed simulations, in a manner mostly transparent to users. • ns-3 shall provide interfaces that facilitate the porting of implementation code (user space and kernel TCP/IP stacks) 1.3 Documentation • Source code APIs shall be documented using Doxygen and available on the web as HTML and Latex-generated PDF. • the various project documents use Latex. The documentation should be checked out nightly, built into PDF and HTML, and posted on the web. Documentation should be stored in the source code repository in source form, with figures stored in eps or image format. Vector graphics should be drawn in a commonly available vector graphics program such as dia, tgif, or xfig, and the sources stored with the eps. 1.4 Requirements from Collaborators This project is collaborating with several other networking research projects. This section is used to document the goals and/or requirements that have been suggested from these other projects. 4 1.4.1 VINI Nick Feamster and George Riley met in September 2006 and agreed that the ns-3 team would strive to support VINI on two basic fronts: • ns-3 simulations will provide some mechanism to "dump" the topology in a format compatible with VINI’s topology description. VINI would then re-create the same topology on the VINI/Planetlab systems and re-create the same experiment. • The ns-3 design will facilitate "easy" (definition of easy TBD) migration of application code to and from VINI. This is harder, but is consistent with our design goals of "easy" integration of existing code (eg. the XORP OSPF implemen- tation). The issues are still evolving, but we expect that whatever solution we converge on for the general case will be sufficient for the VINI case. 1.4.2 Emulab 1.4.3 Network Simulation Cradle 1.4.4 Large scale simulations (include Nick Weaver comments here) 5 Chapter 2 Technical Overview 2.1 Basics ns-3 is a user-space program that runs on Unix- and Linux-based systems and on Windows (build process, via Cygwin or via native win32 APIs, is to be determined). It contains support for the following: • construction of virtual networks (nodes, channels, applications) and supportfor items such as eventschedulers, topology generators, timers, and the like to support discrete-event network simulation focused on Internet-based and possibly other packet network systems. • support for network emulation; the ability for simulator processes to emit and consume real network packets • distributed simulation support; the ability for simulations to be distributed across multiple processors or machines • support for animation of network simulations • support for tracing, logging, and computing statistics on the simulation output ns-3 is written in C++, with a planned Python scripting interface(s) for users. Contributors are expected to conform to the project coding style, licensing, and copyright requirements (licensing and copy- right requirements described in the project plan document). 6 Node App ... App Unix-like APIs (sockets, netfilter, pfkey, etc.) Stack
overload issue 72 april 2006 contents credits & contacts Multithreading 101 Overload Editor: Alan Griffiths Tim Penhey 7 overload@accu.org alan@octopull.demon.co.uk To Grin Again Contributing Editor: Alan Griffiths 10 Mark Radford mark@twonine.co.uk A Fistful of Idioms Steve Love 14 Advisors: Phil Bass C++ Best Practice: phil@stoneymanor.demon.co.uk Designing Header Files Thaddaeus Frogley Alan Griffiths 19 t.frogley@ntlworld.com Richard Blundell Visiting Alice richard.blundell@gmail.com Phil Bass 24 Pippa Hennessy pip@oldbat.co.uk Tim Penhey tim@penhey.net Advertising: Thaddaeus Frogley ads@accu.org Overload is a publication of the ACCU. For details of the ACCU and other ACCU publications and activities, see the ACCU website. ACCU Website: http://www.accu.org/ Information and Membership: Join on the website or contact David Hodge membership@accu.org Publications Officer: John Merrells publications@accu.org Copy Deadlines All articles intended for publication in Overload 73 should be submitted to the editor by ACCU Chair: May 1st 2006, and for Overload 74 by July 1st 2006. Ewan Milne chair@accu.org 3 overload issue 72 april 2006 Editorial: Doing What You Can Your magazine needs you! f you look at the contents of this issue of Overload you’ll see that most of the feature content has been written by the editorial team.You might even notice that the remaining Iarticle is not new material. To an extent this is a predictable consequence of the time of year: many of the potential contributors are busy preparing for the conference. However, as editor for the last couple of years I’ve noticed More on WG14 that there is a worrying decline in proposals for articles Last time I commented on the fact that I was hearing from authors.
General Specification of Basic Software Modules AUTOSAR CP R19-11
General Specification of Basic Software Modules AUTOSAR CP R19-11 Document Title General Specification of Basic Software Modules Document Owner AUTOSAR Document Responsibility AUTOSAR Document Identification No 578 Document Status published Part of AUTOSAR Standard Classic Platform Part of Standard Release R19-11 Document Change History Date Release Changed by Change Description 2019-11-28 R19-11 AUTOSAR Include guard for header files Release minor corrections / clarifications / Management editorial changes; For details please refer to the ChangeDocumentation Changed Document Status from Final to published 2018-10-31 4.4.0 AUTOSAR minor corrections / clarifications / Release editorial changes; For details please Management refer to the ChangeDocumentation 2017-12-08 4.3.1 AUTOSAR minor corrections / clarifications / Release editorial changes; For details please Management refer to the ChangeDocumentation 2016-11-30 4.3.0 AUTOSAR Meta Data handling Release Changed to MISRA C 2012 Management Standard Debugging support was removed minor corrections / clarifications / editorial changes; For details please refer to the ChangeDocumentation 2015-07-31 4.2.2 AUTOSAR Debugging support marked as Release obsolete Management minor corrections / clarifications / editorial changes; For details please refer to the ChangeDocumentation 1 of 86 Document ID 578: AUTOSAR_SWS_BSWGeneral - AUTOSAR confidential - General Specification of Basic Software Modules AUTOSAR CP R19-11 Document Change History Date Release Changed by Change Description 2014-10-31
Rejuvenating C++ Programs through Demacrofication Aditya Kumar Andrew Sutton Bjarne Stroustrup Computer Science Engineering Computer Science Engineering Computer Science Engineering Texas A&M University Texas A&M University Texas A&M University College Station,Texas-77840 College Station,Texas-77840 College Station,Texas-77840 Email: hiraditya@neo.tamu.edu Email: asutton@cse.tamu.edu Email: bs@cs.tamu.edu Abstract—We describe how legacy C++ programs can be of the C preprocessor has been reduced. The use of general- rejuvenated using C++11 features such as generalized constant ized constant expressions, type deduction, perfect forwarding, expressions, perfect forwarding, and lambda expressions. In lambda expressions, and alias templates eliminate the need for general, this work develops a correspondence between different kinds of macros and the C++ declarations to which they should many previous preprocessor-based idioms and solutions. be transformed. We have created a set of demacrofication tools Older C++ programs can be rejuvenated by replacing error- to assist a developer in the rejuvenation of C++ programs. To prone uses of the C preprocessor with type safe C++11 evaluate the work, we have applied the rejuvenation tools to declarations. In this paper, we present methods and tools a number of C++ libraries to assess the extent to which these to support the task of demacrofying C++ programs during libraries might be improved by demacrofication. Results indicate that between 68 and 98% of potentially refactorable macros could rejuvenation. This task is intended to be completed with the be transformed into C++11 declarations. Additional experiments help of a programmer; it is not a fully automated process.
More C++ Idioms/Print Version 1 More C++ Idioms/Print Version
More C++ Idioms/Print Version 1 More C++ Idioms/Print Version Preface [1] C++ has indeed become too "expert friendly" --- Bjarne Stroustrup, The Problem with Programming , Technology Review, Nov 2006. Stroustrup's saying is true because experts are intimately familiar with the idioms in the language. With the increase in the idioms a programmer understands, the language becomes friendlier to him or her. The objective of this open content book is to present modern C++ idioms to programmers who have moderate level of familiarity with C++, and help elevate their knowledge so that C++ feels much friendlier to them. It is designed to be an exhaustive catalog of reusable idioms that expert C++ programmers often use while programming or designing using C++. This is an effort to capture their techniques and vocabulary into a single work. This book describes the idioms in a regular format: Name-Intent-Motivation-Solution-References, which is succinct and helps speed learning. By their nature, idioms tend to have appeared in the C++ community and in published work many times. An effort has been made to refer to the original source(s) where possible; if you find a reference incomplete or incorrect, please feel free to suggest or make improvements. The world is invited to catalog reusable pieces of C++ knowledge (similar to the book on design patterns by GoF). The goal here is to first build an exhaustive catalog of modern C++ idioms and later evolve it into an idiom language, just like a pattern language. Finally, the contents of this book can be redistributed under the terms of the GNU Free Documentation License.
Lecture 5: Operator Overloading and Structuring Programs
Math 4997-3 Lecture 5: Operator overloading and structuring programs https://www.cct.lsu.edu/~pdiehl/teaching/2019/4977/ This work is licensed under a Creative Commons “Attribution-NonCommercial- NoDerivatives 4.0 International” license. Reminder Operator overloading Structure of code Header files Class types CMake Summary Reminder Lecture 4 What you should know from last lecture I N-Body simulations I Struct I Generic programming (Templates) Operator overloading Compilation error error: no match for ‘operator’+ (operand types are ‘’vector and ‘’vector) Example Vector template<typename T> struct vector { T x; T y; T z; }; Addition of two vectors vector <double > a; vector <double > b; std::cout << a + b << std::endl; Example Vector template<typename T> struct vector { T x; T y; T z; }; Addition of two vectors vector <double > a; vector <double > b; std::cout << a + b << std::endl; Compilation error error: no match for ‘operator’+ (operand types are ‘’vector and ‘’vector) Operator overloading1 template<typename T> struct vector { T x; T y; T z; // Overload the addition operator vector<T> operator+(const vector<T> rhs){ return vector<T>( x + rhs.x, y + rhs.y, z + rhs.z ); } }; Following operators can be overloaded I 38 operators can be overloaded I 40 operators can be overloaded, since C++ 20 1 https://en.cppreference.com/w/cpp/language/operators D’oh! error: no match for ‘operator’<< (operand types are ‘std::ostream {aka std::basic_ostream’} and ‘’vector) std::cout << a + b << std::endl; Can we compile now? template<typename T> struct
SOI 506 New 1.0 05/05/2006 by Alward Siyyid (Raytheon Information Solutions) Document Revision by Ken Jensen (Raytheon Information Solutions)
NOAA NESDIS CENTER for SATELLITE APPLICATIONS and RESEARCH TRAINING DOCUMENT TD-11.2 C PROGRAMMING STANDARDS and GUIDELINES Version 3.0 Hardcopy Uncontrolled NOAA/NESDIS/STAR TRAINING DOCUMENT TD-12.1.3 Version: 2.0 Date: September 30, 2007 TITLE: C Programming Standards and Guidelines Page 2 of 54 TITLE: TD-11.2: C PROGRAMMING STANDARDS AND GUIDELINES VERSION 3.0 AUTHORS: Alward Siyyid (formerly Raytheon Information Solutions – version 1) Ken Jensen (Raytheon Information Solutions) Peter Keehn (PSGS) Shanna Sampson (PSGS) C PROGRAMMING STANDARDS AND GUIDELINES VERSION HISTORY SUMMARY Version Description Revised Date Sections New Work Instruction (WI) adapted from Raytheon SOI 506 New 1.0 05/05/2006 by Alward Siyyid (Raytheon Information Solutions) Document Revision by Ken Jensen (Raytheon Information Solutions). 1.1 All 06/02/2006 Applied STAR standard style to entire document. Revision by Shanna Sampson (Perot), Peter Keehn (Perot), and Ken Jensen (Raytheon Information Solutions). Changed 2.0 from WI-12.1.2 to Training Document TD-12.1.3 for version All 09/30/2007 2 of the STAR Enterprise Product Lifecycle (EPL). Numerous revisions in response to peer review comments. Renamed TD-11.2 and revised by Ken Jensen (RIS) for 3.0 1, 2 10/1/2009 version 3. Hardcopy Uncontrolled NOAA/NESDIS/STAR TRAINING DOCUMENT TD-12.1.3 Version: 2.0 Date: September 30, 2007 TITLE: C Programming Standards and Guidelines Page 3 of 54 TABLE OF CONTENTS Page LIST OF ACRONYMS ....................................................................................... 5 1. INTRODUCTION ........................................................................................ 6 1.1. Objective......................................................................................... 6 1.2. Background .................................................................................... 7 1.3. C Versions ...................................................................................... 8 1.4.
Massively Parallel Algorithm for Solving the Eikonal Equation on Multiple Accelerator Platforms
MASSIVELY PARALLEL ALGORITHM FOR SOLVING THE EIKONAL EQUATION ON MULTIPLE ACCELERATOR PLATFORMS by Anup Shrestha A thesis submitted in partial fulfillment of the requirements for the degree of Master of Science in Computer Science Boise State University December 2016 c 2016 Anup Shrestha ALL RIGHTS RESERVED BOISE STATE UNIVERSITY GRADUATE COLLEGE DEFENSE COMMITTEE AND FINAL READING APPROVALS of the thesis submitted by Anup Shrestha Thesis Title: Massively Parallel Algorithm for Solving the Eikonal Equation on Multiple Accelerator Platforms Date of Final Oral Examination: 14 October 2016 The following individuals read and discussed the thesis submitted by student Anup Shrestha, and they evaluated his presentation and response to questions during the final oral examination. They found that the student passed the final oral examination. Elena A. Sherman, Ph.D. Chair, Supervisory Committee Inan¸cS¸enocak,_ Ph.D. Co-Chair, Supervisory Committee Steven M. Cutchin, Ph.D. Member, Supervisory Committee The final reading approval of the thesis was granted by Elena A. Sherman, Ph.D., Chair of the Supervisory Committee. The thesis was approved by the Graduate College. ACKNOWLEDGMENTS I would like to thank my advisors Dr. Elena Sherman and Dr. Inan¸cS¸enocak_ for their continuous guidance and support throughout the course of this Master's thesis. I would also like to thank Dr. Steven Cutchin for serving on my thesis supervisory committee. Many thanks to Boise State University and Jason Cook in particular for help with the local computing infrastructure and installation of various tools and libraries. I would also like to thank my colleagues Rey DeLeon and Micah Sandusky, from the High Performance Simulation Laboratory for Thermo-Fluids, for their help and willingness to answer my questions.