scalable and portable visualization of large atomistic...

12
Computer Physics Communications 163 (2004) 53–64 www.elsevier.com/locate/cpc Scalable and portable visualization of large atomistic datasets Ashish Sharma , Rajiv K. Kalia, Aiichiro Nakano, Priya Vashishta Collaboratory for Advanced Computing and Simulations, Department of Computer Science, Department of Physics & Astronomy, Department of Material Science & Engineering, University of Southern California, Los Angeles, CA 90089-0242, USA Received 15 June 2004; accepted 8 July 2004 Available online 16 September 2004 Abstract A scalable and portable code named Atomsviewer has been developed to interactively visualize a large atomistic dataset consisting of up to a billion atoms. The code uses a hierarchical view frustum-culling algorithm based on the octree data structure to efficiently remove atoms outside of the user’s field-of-view. Probabilistic and depth-based occlusion-culling algorithms then select atoms, which have a high probability of being visible. Finally a multiresolution algorithm is used to render the selected subset of visible atoms at varying levels of detail. Atomsviewer is written in C++ and OpenGL, and it has been tested on a number of architectures including Windows, Macintosh, and SGI. Atomsviewer has been used to visualize tens of millions of atoms on a standard desktop computer and, in its parallel version, up to a billion atoms. Program summary Title of program: Atomsviewer Catalogue identifier: ADUM Program summary URL: http://cpc.cs.qub.ac.uk/summaries/ADUM Program obtainable from: CPC Program Library, Queen’s University of Belfast, N. Ireland Computer for which the program is designed and others on which it has been tested: 2.4 GHz Pentium 4/Xeon processor, professional graphics card; Apple G4 (867 MHz)/G5, professional graphics card Operating systems under which the program has been tested: Windows 2000/XP, Mac OS 10.2/10.3, SGI IRIX 6.5 Programming languages used: C++, C and OpenGL Memory required to execute with typical data: 1 gigabyte of RAM High speed storage required: 60 gigabytes No. of lines in the distributed program including test data, etc.: 550 241 No. of bytes in the distributed program including test data, etc.: 6 258 245 Number of bits in a word: Arbitrary This paper and its associated computer program are available via the Computer Physics Communications homepage on ScienceDirect (http://www.sciencedirect.com/science/journal/00104655 ). * Corresponding author. E-mail address: [email protected] (A. Sharma). 0010-4655/$ – see front matter 2004 Elsevier B.V. All rights reserved. doi:10.1016/j.cpc.2004.07.008

Upload: others

Post on 25-May-2020

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Scalable and portable visualization of large atomistic ...cacs.usc.edu/papers/Sharma-viz-CPC04.pdfScalable and portable visualization of large atomistic datasets Ashish Sharma∗,

c

ts

ic datasetstructurems thenelected

ted on aillions of

r,

ct

Computer Physics Communications 163 (2004) 53–64

www.elsevier.com/locate/cp

Scalable and portable visualization of large atomistic datase✩

Ashish Sharma∗, Rajiv K. Kalia, Aiichiro Nakano, Priya Vashishta

Collaboratory for Advanced Computing and Simulations, Department of Computer Science, Department of Physics & Astronomy,Department of Material Science & Engineering, University of Southern California, Los Angeles, CA 90089-0242, USA

Received 15 June 2004; accepted 8 July 2004

Available online 16 September 2004

Abstract

A scalable and portable code named Atomsviewer has been developed to interactively visualize a large atomistconsisting of up to a billion atoms. The code uses a hierarchical view frustum-culling algorithm based on the octree datato efficiently remove atoms outside of the user’s field-of-view. Probabilistic and depth-based occlusion-culling algorithselect atoms, which have a high probability of being visible. Finally a multiresolution algorithm is used to render the ssubset of visible atoms at varying levels of detail. Atomsviewer is written in C++ and OpenGL, and it has been tesnumber of architectures including Windows, Macintosh, and SGI. Atomsviewer has been used to visualize tens of matoms on a standard desktop computer and, in its parallel version, up to a billion atoms.

Program summary

Title of program: AtomsviewerCatalogue identifier: ADUMProgram summary URL: http://cpc.cs.qub.ac.uk/summaries/ADUMProgram obtainable from: CPC Program Library, Queen’s University of Belfast, N. IrelandComputer for which the program is designed and others on which it has been tested: 2.4 GHz Pentium 4/Xeon processoprofessional graphics card; Apple G4 (867 MHz)/G5, professional graphics cardOperating systems under which the program has been tested: Windows 2000/XP, Mac OS 10.2/10.3, SGI IRIX 6.5Programming languages used: C++, C and OpenGLMemory required to execute with typical data: 1 gigabyte of RAMHigh speed storage required: 60 gigabytesNo. of lines in the distributed program including test data, etc.: 550 241No. of bytes in the distributed program including test data, etc.: 6 258 245Number of bits in a word: Arbitrary

✩ This paper and its associated computer program are available viathe Computer Physics Communications homepage on ScienceDire(http://www.sciencedirect.com/science/journal/00104655).

* Corresponding author.E-mail address: [email protected](A. Sharma).

0010-4655/$ – see front matter 2004 Elsevier B.V. All rights reserved.doi:10.1016/j.cpc.2004.07.008

Page 2: Scalable and portable visualization of large atomistic ...cacs.usc.edu/papers/Sharma-viz-CPC04.pdfScalable and portable visualization of large atomistic datasets Ashish Sharma∗,

54 A. Sharma et al. / Computer Physics Communications 163 (2004) 53–64

n, and

Nakano,ors and

Number of processors used: 1Has the code been vectorized or parallelized: NoDistribution format: tar gzip fileNature of physical problem: Scientific visualization of atomic systemsMethod of solution: Rendering of atoms using computer graphic techniques, culling algorithms for data minimizatiolevels-of-detail for minimal renderingRestrictions on the complexity of the problem: NoneTypical running time: The program is interactive in its executionUnusual features of the program: NoneReferences: The conceptual foundation and subsequent implementation of the algorithms are found in [A. Sharma, A.R.K. Kalia, P. Vashishta, S. Kodiyalam, P. Miller, W. Zhao, X.L. Liu, T.J. Campbell, A. Haas, Presence—TeleoperatVirtual Environments 12 (1) (2003)]. 2004 Elsevier B.V. All rights reserved.

PACS: 07.05.Rm; 02.70.Ns

Keywords: Visualization; Hierarchical view frustum culling; Probabilistic occlusion culling; Multiresolution algorithm; Molecular dynamics

rge

dy-ed

nech-sesofame

e

-tion

lexat-

rial,or-elpsem.

nded.msalyc-vel-

om-m

s.s

e ofal-ion

m-tedro-

e

se-s-

athe

1. Introduction

Recent developments in simulation algorithms andparallel computing technologies have enabled laatomistic simulations involving million-to-billionatoms. For example, some of the largest molecularnamics (MD) simulations of materials have involvmultibillion atoms [1–3]. In these large-scale MDsimulations, explorative visualization of simulatiodatasets is essential for understanding atomistic manisms underlying macroscopic material proces[4,5]. Output data from an MD simulation consistsa time series of atomistic data frames. Each data fris a table consisting ofN rows forN atoms, and theith row Ri is a tuple of atomistic attributes of theithatom. As a specific example, the tuple could be

(1)Ri = (λi , ri ,vi , σi),

whereλi ∈ {C,Si, . . .} is the chemical species of thith atom,ri ∈ �3, vi ∈ �3, andσi = (σ xx

i , σyy

i , σ zzi ,

σyzi , σ zx

i , σxyi ) ∈ �6 are its 3D coordinate, 3D veloc

ity, and 6-component stress tensor at the simulatime step this data frame is taken from, seeFig. 1.Macroscopic material properties result from compspatio-temporal interactions among these atomistictributes, and navigating inside the simulated matewhile animating the data frames with atoms colcoded according to one of these attributes, often hscientists to uncover causal relationships among th

A major challenge in navigating through a high-eMD simulation dataset is to achieve interactive speAlthough there are quite a few excellent prograto visualize atomistic datasets (e.g., VMD—VisuMolecular Dynamics[6]), we are not aware of ancapable of rendering multimillion atoms within a fration of second. In the past years, we have been deoping a scalable and portable software named Atsviewer for visualizing large atomistic datasets fromaterials simulations involving billions of atomAtomsviewer can visualize tens of millions of atomon a standard desktop computer, with extensive usmultilevel and probabilistic algorithms, and its parlel version has been used to visualize up to a billatoms[7].

This paper provides a technical overview of Atosviewer, the source code of which is disseminathrough the Computer Physics Communications Pgram Library, and documentation describing its usagis contained in the appendices. Section2 presents anoverview of Atomsviewer, and its different algorithmare described in Section3. Numerical test results arpresented in Section4, and Section5 contains the summary. Instructions on compiling and building Atomviewer, is contained inAppendix A.

2. System overview

Visualization of large-scale MD simulations isnontrivial problem because of the large size of

Page 3: Scalable and portable visualization of large atomistic ...cacs.usc.edu/papers/Sharma-viz-CPC04.pdfScalable and portable visualization of large atomistic datasets Ashish Sharma∗,

A. Sharma et al. / Computer Physics Communications 163 (2004) 53–64 55

thes,

tress,

Fig. 1. Visualization of a data frame from an MD simulation of nanoindentation in crystalline silicon carbide (3CSiC), in which a quarter ofsystem is cut out to make atoms inside the SiC substrate visible[8]. Dots, small spheres, and large spheres represent indenter, Si, and C atomrespectively. Atoms are color-coded with: (left) species (magenta—indenter, red—Si, green—C); and (right) direction-averaged shear sσs = (σyz + σzx + σxy)/3.

.rgelet

t in-e-here

s aom-t al-tem.a

notar-hisg

go-ddi-msar-w-

o-ureters aehe

and

x-tar’s

ughfineionid-oc-theThesnap-ke a

athe

stantex-thatld-isus-ss

s-bysion

dataset. For example, an example data frame in Eq(1)for a 10 million-atom MD simulation contains, foa given time step, 130 million numbers. The larsize makes it hard for a single system to store,alone process, data at speeds that would permiteractive rendering. Rendering millions of atoms bcomes harder, since each atom, rendered as a spuses approximately 50 triangular primitives. This iproblem shared by the entire computer graphics cmunity, where the dataset to be rendered almosways exceeds the capabilities of the rendering sysThis problem is however overcome by followingsimple rule, i.e., “avoid processing data that canbe seen from the viewer’s current perspective”. Vious algorithms have been developed following trule. In Atomsviewer, these include frustum-cullinand probabilistic/depth based occlusion-culling alrithms, each using the octree data abstraction. Ational user defined filters allow the user to select atothat satisfy a certain criterion. Finally we have anchitecture that provides the user with multiple viepoints, enhancing the user experience.Fig. 2shows thebreakdown of Atomsviewer into its respective compnents and the interaction amongst them. In this figwe show the two main applications—FileConverand Atomsviewer. The FileConverter program readplain text file and converts it into a format, in which thatoms are spatially and chronologically clustered. TAtomsviewer program accepts the user position

,

orientation, and feeds this information to the Data Etraction Module (DEM). The DEM traverses the dafile and extracts spatial clusters that fit in the usefield-of-view. These clusters are then passed throuser defined coarse and fine grain filters that rethe data. This data is then filtered in the OcclusCulling Module to remove those atoms that are hden from the viewer on account of other atomscluding them. Finally the Graphic Modules renderatoms as spheres of varying size and resolution.user can also capture the rendered scene as ashot or a series of time-stamped snapshots to mamovie.

3. Data extraction and rendering algorithms

Visualizing a large atomistic dataset requiresfast and scalable data management system. Whiledataset is large, what the user sees at any given inis a relatively small subset. This observation can beploited in designing a data management schemeefficiently extracts atoms that are in the user’s fieof-view. In computer graphics, the field-of-viewdefined with a truncated pyramidal shape called frtum, and view frustum culling refers to the proceof removing atoms that lie outside of it. After frutum culling, atoms that are hidden from the viewerother atoms are removed by a process called occlu

Page 4: Scalable and portable visualization of large atomistic ...cacs.usc.edu/papers/Sharma-viz-CPC04.pdfScalable and portable visualization of large atomistic datasets Ashish Sharma∗,

56 A. Sharma et al. / Computer Physics Communications 163 (2004) 53–64

Fig. 2. A schematic of the Atomsviewer program showing itsmain components and the flow of information among them.

en-eredtheids,

n ofevel

em-

fors-

lus-an-ner-nal

omsthe

act-a-he

enlt-

ionen--s,

nal

c-fis

x-

ac-thelv-fi-an

e-can

r areiontions a

esrsect

culling. At this stage the atoms are ready to be rdered as spheres. However not all atoms are rendat the same resolution. Atoms that are far fromviewer will be rendered as coarse spheres, pyramand even points. The decision about the resolutiothe rendered atoms is known as selecting the Lof Detail (LOD). The following subsections describthe sequence of rendering algorithms used in Atosviewer.

3.1. Hierarchical view frustum culling

To achieve interactive speed and scalabilityview frustum culling, spatially close atoms are clutered to provide a convenient abstraction. The ctering of atoms is performed hierarchically, usingoctree data structure[9,10]. An octree is a threedimensional extension of a binary search tree, geated by recursively subdividing the three-dimensiospace into smaller subregions, seeFig. 3. Each oc-tree node thus becomes an abstraction of the atcontained in its subspace, and we can transformprocess of extracting atoms to a process of extring regions that lie in the frustum. This transformtion improves the system performance as follows. Ttotal computation time is a sum of the time takin culling and the time taken to render the resu

ing reduced set of atoms. For a typical visualizatthe number of rendered atoms is nearly indepdent of the user’s viewpoint. The culling time however scales linearly with the total number of atomand with the octree abstraction, the computatiocomplexity is reduced from O(N) to O(log(N/m)),wherem is the number of atoms mapped to an otree node. The numberm determines the number osubdivisions (or the depth of the octree), and itempirically set to∼ 500. This number comes froma trade-off between the quality of frustum approimation, and the computation time. A larger depthimplies smaller regions and therefore a morecurate representation of the frustum, but withpenalty of greater computation. Our tests invoing million-to-billion atom datasets show no signicant visual gains with a granularity that is finer th500 atoms/region.

View frustum culling is implemented using a sries of bounding volumes. These are shapes thatbe used to select all octree nodes that intersect ocontained in them. Their size, position and orientatin 3D space are determined from the user’s posiand orientation. The first and foremost of these isphere,S, that fully encloses the frustum[7]. A coarseextraction is done by approximating all octree nodas spheres and selecting those spheres that inte

Page 5: Scalable and portable visualization of large atomistic ...cacs.usc.edu/papers/Sharma-viz-CPC04.pdfScalable and portable visualization of large atomistic datasets Ashish Sharma∗,

A. Sharma et al. / Computer Physics Communications 163 (2004) 53–64 57

tains

e

Fig. 3. A three-level octree. Each octree node contains the coordinatebounds of the corresponding subspace. A terminal node at level 2 cona pointer to a structure that stores data associatedwith atoms in the region defined by the terminal node.

Fig. 4. The octree data structure overlain on theatomistic data. The figure shows only the atoms that are selected for subsequent rendering. Tharrow denotes the position and orientation of the viewer.

ra-y if

(re-eandap-

ec-

sre-ontheuf-anym-

s

with S. This process is implemented through a tversal of the octree, where a node is tested onlthe sphere of the parent node intersectsS. The endresult of the process is a set of terminal nodesgions), all of which intersectS. These regions arthen pruned by testing them against a cylindersubsequently a cone, each of which improves theproximation of the frustum.Fig. 4 shows one suchextracted view frustum from a third person persptive.

3.2. Probabilistic occlusion culling

After view frustum culling, we have a list of regionthat completely occupy the view frustum. We canfine this selection by repeating the frustum cullingatoms of those regions that lie on the boundary ofview frustum. However this test is redundant if a sficient octree depth is taken. There are however matoms that are in the view frustum that will be copletely hidden from the viewer because of other atom

Page 6: Scalable and portable visualization of large atomistic ...cacs.usc.edu/papers/Sharma-viz-CPC04.pdfScalable and portable visualization of large atomistic datasets Ashish Sharma∗,

58 A. Sharma et al. / Computer Physics Communications 163 (2004) 53–64

msalloms

si-is

erheheser)

estus-h

efulu-

c-vingen-nd

in-em.oxi-jec-hatorde-instintsraythes is

d intoe.

use

t isted.ingit on

er,

msthel-

theof

ng.ear-

-

m-n.uma

es-ionberereof

aveich

al-ous

ingableamtoif-

les,r ta-

that are closer to the viewer. To remove these atowe begin occlusion culling. In this process we sortvisible regions in an increasing order of distance frthe viewer.1 If atoms are uniformly distributed acrosregions,2 a region that is closer to the viewer’s potion will contain more visible atoms than one thatfurther away. This is because the atoms in the nearregion will probably occlude many of the atoms in tfarther regions. Thus we calculate the visibility (tfraction of atoms that are probably seen by the uof an octree region from the recurrence relation,

(2)vc = (1− Dc)vc−1,

wherevc is the visibility of thecth octree region andDc is the normalized density of atoms in thecth oc-tree region. The 0th octree region is the one closto the viewer. The leaf octree regions are traverseding a line-drawing algorithm, and the visibility of eaccell is calculated using Eq.(2). In addition to beingused in billion-atom datasets, this technique is uswhen the viewer is moving. The probabilistic occlsion culling decimates atoms with probability 1− vc ,with typically a few percent pixel loss. This loss is aceptable since the user is navigating and not obserthe scene. Computationally, this technique is inexpsive since visibility is assigned to octree regions anot the actual atoms.

3.3. Depth based occlusion culling

The final step in data extraction involves testingdividual atoms to see if any other atoms occlude thIn this test, atoms in the nearest regions are apprmated as cubes that fully enclose the spherical protion of the atom. This cube is marked on an array tmimics the viewer’s screen. The array entries recthe distance of a particular atom from the viewer. Bfore an array entry can be updated, it is tested agaexisting entries. For this test, a few chosen test poare compared with the pre-existing entries in the ar(the distance of the currently recorded atoms fromviewer). If the distance is less, then the new atom

1 This sorted order of visible regions is subsequently reusethe final rendering stages of the atoms when decisions pertainingthe quality/resolution of the rendering of atoms have to be mad

2 This assumption holds for very large datasets, and thus wethe probabilistic technique in parallel implementation.

closer to the viewer and it will occlude the atom tharecorded in the array. The array entry is thus updaAs the array starts to fill up, we can stop conductthis test on a per atom basis and instead conducta per-region basis. If the area occupied by thecth re-gion is occluded by atoms that are closer to the viewthen we can avoid the per-atom testing for regionc.

3.4. Multiresolution rendering

The atoms selected by the above culling algorithare rendered as spheres at various LODs usingOpenGL API[11]. The resolution of the sphere is caculated from an exponential function of distance ofatom from the viewer. We first use the sorted listvisible regions that was created in occlusion culliThis list provides an approximate measure of the nest and farthest atoms, and accordingly we normalizethe distance in the range[0,1]. The normalized resolution valuer is calculated as

(3)r = 2− 2x2,

wherex is the normalized distance of the atom frothe viewer. This resolution valuer is defined as a fraction of the maximum resolution of the visualizatioThese resolution values are mappings to the maximnumber of polygons that will be used in renderingsphere. As a trivial optimization, we calculate the rolution value on a per-atom basis, only if the resolutvalue of the region is greater than 0.7 and the numof resolutions is greater than 10. These numbers wempirically chosen from optimal speed and qualitythe rendered image. Additionally the atoms that ha resolution of 1 are usually rendered as points (whare faster to render).

The color of atoms is calculated as discrete vues when visualizing atomic species and as continuvalues, mapped from a color table, when visualizatomistic attributes such as pressure. The color tuses the gradient function of the imaging progrGIMP [12], and it can be manipulated at runtimeallow the user to get the best visualization effects. Dferent attributes are mapped to different color taband the program comes with several standard colobles.

Page 7: Scalable and portable visualization of large atomistic ...cacs.usc.edu/papers/Sharma-viz-CPC04.pdfScalable and portable visualization of large atomistic datasets Ashish Sharma∗,

A. Sharma et al. / Computer Physics Communications 163 (2004) 53–64 59

for

Fig. 5. Rendering time per scene as a function of the number of atoms for the parallel and distributed Atomsviewer is compared with thosethe serial Atomsviewer with and without the octree enhancement.

lledf a

theTo

thateir

aingWetes.ual-ainneshenly

uildd ofent

s fo-

set

s ofsed

y at-

onsingsetsmiskdevel-

eral-h-e-eds-x-is

wer

3.5. User controlled data filters

The final data selection process is user controand gives the user an ability to view the insides odataset. A typical usage is illustrated inFig. 1, whereone quarter of the system was cut out to observeinside and outside of the system simultaneously.make such a cut at runtime, we use cut-planesare aligned along the 6 surfaces. By controlling thpositions, we can make different cuts or slices insystem. The quarter cut is implemented by excludatoms whose positions lie outside a certain value.can also exclude atoms on the basis of their attribuSuch an attribute-based plane is used, e.g., in visizing atoms whose temperature lies within a certrange. Different attribute and position-based placan be combined using Boolean operators, and wcoupled with color tables, provide the user with highcustomized visualization tools.

This paper includes documentation needed to band use Atomsviewer. The appendices at the enthis paper detail the various stages of deploymand subsequent usage of the program.Appendix Adescribes the system requirements and the stepbuilding Atomsviewer on a Windows, Apple Macintosh and SGI computers.Appendix Boutlines the vari-ous components of the program and their purpose.Ap-

r

pendix Cdescribes how a user can convert their datato the Atomsviewer file format. Finally,Appendix Dcontains a complete list of commands and optionthe Atomsviewer program. These commands are uto set and manipulate the color, camera and displatributes of the visualization.

4. Numerical results

The techniques mentioned in the previous sectihave made Atomsviewer scalable, while maintaingood frame rates. However, when visualizing datawith a billion atoms or more, we run into systelimitations such as slow memory bandwidth and dstorage space. To address these issues, we haveoped a parallel and distributed version of Atomsview[4,5].3 We have tested the scalability of the parlel and distributed architecture and associated tecniques.Fig. 5 compares the timing results of the srial Atomsviewer with and without the octree-basview frustum culling with that of the parallel and ditributed Atomsviewer. We see that the time to etract and render the atoms within the field-of-view

3 We plan to release the parallel and distributed Atomsvieshortly.

Page 8: Scalable and portable visualization of large atomistic ...cacs.usc.edu/papers/Sharma-viz-CPC04.pdfScalable and portable visualization of large atomistic datasets Ashish Sharma∗,

60 A. Sharma et al. / Computer Physics Communications 163 (2004) 53–64

s.er-ta-

odegeum-s-asmsup

I,

-ede-

ngeonom-

thela-

ild-temas

ths-

ted

dm

-a-

essedas

rom

2ndca-

ct

s-a-

.

inge-

ol-

-

-esve

nearly a constant function of the number of atomThe communication overhead is successfully ovcome by overlapping communication and compution [4].

5. Summary

We have developed a scalable and portable cnamed Atomsviewer to interactively visualize laratomistic datasets, based on hierarchical view frustculling, probabilistic occlusion-culling, and multireolution rendering algorithms. The Atomsviewer hbeen used to visualize up to tens of millions of atoon a serial computer and, with its parallel version,to a billion atoms.

Acknowledgement

This work was partially supported by ARL: CHSSARO: MURI, DARPA: PROM, DOE, NSF, andAFOSR: DURINT—USC-Berkeley-Princeton. Visualization data were taken from simulations performat Department of Defense (DoD)’s Major Shared Rsource Centers under DoD CHSSI and Challeprojects. Parallel simulations were also performedthe 1896-processor HPC cluster at the Research Cputing Facility and 422-processor Linux clusters atCollaboratory for Advanced Computing and Simutions at the University of Southern California.

Appendix A. Compiling Atomsviewer

The library program includes files to ease the buing of the executable from the source code. The sysrequirement for compilation on various platforms isfollows.

Windows:

(1) Visual Studio .NET 2003.(2) OpenGL: Microsoft ships the OpenGL API wi

Windows 2000/XP. For an older system or for sytems without OpenGL, the API and its associalibraries can be downloaded fromhttp://www.opengl.org.

(3) GLUT: This is the windowing toolkit that is useby Atomsviewer, and is freely available frohttp://www.xmission.com/~nate/glut.html.

(4) Tiff Libraries: These libraries are used by Atomsviewer to make image files from the visualiztion. They can be downloaded fromhttp://www.libtiff.org/.

(5) GIMP: This is an imaging program, which makit easy to create color gradients that are uto visualize continuous data attributes suchstress and temperature. It can be downloaded fhttp://www.gimp.org.

Mac OS X:

(1) Apple Xcode or Project Builder v2.1 (Dec 200Tools) or higher: These include the OpenGL aGLUT Frameworks that are used by the applition.

(2) gcc compiler, v3.1 or higher: Xcode and Projebuilder ship with this version.

(3) Tiff libraries: These libraries are used by Atomviewer to make image files from the visualiztion. They can be downloaded fromhttp://www.libtiff.org or by using Fink (http://fink.sourceforgenet).

(4) GIMP: This program can be downloaded usFink. Doing so will ensure that all the required dpendencies are installed.

SGI Irix:

(1) gcc version 3.1 or higher.(2) OpenGL & GLUT.(3) Tiff libraries.(4) GIMP.

Once Atomsviewer is built, a setup file and the flowing executables are created:

• Atomsviewer: This is the visualization program.• FileConverter: This is the program that will con

vert a text file to the av file format.• AV_Setup.txt: This file is used by the FileCon

verter and Atomsviewer to identify the directorithat will be used by the program to load and safiles. A user must edit this file according to theirsystem setup.

Page 9: Scalable and portable visualization of large atomistic ...cacs.usc.edu/papers/Sharma-viz-CPC04.pdfScalable and portable visualization of large atomistic datasets Ashish Sharma∗,

A. Sharma et al. / Computer Physics Communications 163 (2004) 53–64 61

eprom

sFor

ationbese-

and-

d

tputd ary

he

of

m:ce

er.ot

isch

ce

tedin

hed

t thehe

toe in-

ith

i-hebe

intoeatae,woelesatm.

se-

tnethem-is-Chats:ns.ed

Appendix B. Using Atomsviewer

The typical use of Atomsviewer is a three-stprocess. In the first step, the data is converted fa text format to an Atomsviewer format (.av format)using theFileConverter program. This conversion irequired the first time the user visualizes a dataset.subsequent use the user will use the file in the .av for-mat. Once the data has been converted, a configurfile needs to be created, and color tables that willused to color the various data attributes, need to belected/created. Finally theAtomsviewer program canbe used to visualize the data file. These three stepsthe programs associated withthem are described in detail in the following appendices.

Appendix C. File conversion using FileConverter

UsageFileConverter [-L | -E ] [ -C ] text file

DescriptionTheFileConverter program will read a text file an

convert it to an .av format. This text file will containall the data that a user wants to visualize. The oufile will have the same name as the input file an.av extension. It will be created in the same directoas the input file. The input text file should be of tfollowing layout:

(1) The first line of the file indicates the numberframes (or time steps) in the file.This is requiredeven if there is only one frame in the system.

(2) The second line indicate the number of atoms,N ,in the first frame.

(3) The third line contains the data for an atom frothe first frame. This line is structured as follows• x, y, z coordinates delimited by a white-spa

or a tab.• White-space/tab.• The species of the atom as a positive integ

If all the atoms are identical or this field is nrecorded, then set this to 1.

• White-space/tab.• Multiple data attributes associated with th

atom as integers/floating-point numbers. Eadata attribute will be delimited by a white-spaor a tab. Data attributes are optional.

Once all the atoms of frame 1 have been lis(N atoms from line 2), list the number of atomsframe 2 and so on.

Options

-L Specify the octree level that will be used in tcreation of the output file. This option is ignoreif the -E option is specified.

-E Causes the program to make a decision abouoctree level that will be used in the creation of toutput file.

-C Causes a configuration file with typical settingsbe created. This file has the same name as thput file but with a .cfg extension. The input filethat needs to be converted must be specified wits full path.

Output

The following files are created.

(1) Atomsviewer file: An Atomsviewer file is a bnary file with an .av extension that contains tpositions and data of all the atoms that willvisualized. The atoms are spatially organizedthe file with file headers at frequent intervalsallow the program to skip over portions of thfile that are not being rendered. Since atomic dmight contain data attributes such as temperaturenergy, etc., the file is actually composed of tparts. A main file with only the positions and thspecies of all the atoms and a set of data fi(with extensions .av.1, .av.2, etc.) that containmost 3 data attributes for every atom in the systeThe FileConverter program automatically createthese data files, when the Atomsviewer file is bing created.

(2) Configuration file: A configuration file is a texfile, with a .cfg extension, that is used to defivarious graphic properties such as the size ofatomic representations and their colors, the caera viewpoints etc. A basic configuration filecreated by the FileConverter program with theoption. The file consists of a set of commands tcan describe any one of the following propertie• Color and radius of the atomic representatio• Color gradient files that specify the colors, us

to visualize various data attributes.

Page 10: Scalable and portable visualization of large atomistic ...cacs.usc.edu/papers/Sharma-viz-CPC04.pdfScalable and portable visualization of large atomistic datasets Ashish Sharma∗,

62 A. Sharma et al. / Computer Physics Communications 163 (2004) 53–64

ay

gu-

n bemeof-e

-

rstes.the

radi-usand

atatynhatxaff

sesn

at,

-ishw,thetheiller

of

adif-fer-ve-

hots

toon.re-can

un-

A

s of.0

g

m-larrnda

era.onesion

heofcre-

s

yf

• Color and format specifier for the main displlabel.

• Camera position and direction.The various commands that constitute a confiration file are listed inAppendix D. These com-mands are the same as the commands that caexecuted at runtime. It is important that the naof a configuration file must be identical to thatthe Atomsviewer file with only a different extension. For example, an Atomsviewer file with thname of foo.run1.txt.av would have a configuration file called foo.run1.txt.cfg.

(3) Color gradient file: This file describes the colothat are used to visualize various data attribuThe color gradient files have the same name asAtomsviewer file but with an extension of.col.1where the number 1 at the end associates a gent file with the data attribute in the data file. Than extension of.3 would stand for the third datattribute in the system excluding the position aspecies of the atoms.To create a color gradient file, first scale the drange to[0,1] and then use the gradient faciliof the program GIMP (GNU Image ManipulatioProgram). GIMP is an open source program tis freely available and runs on Windows, Linuand Mac platforms. The color gradient file isplain text file that gives the color at various cutopoints between 0 and 1. Atomsviewer then uthis information to interpolate the color for a givevalue. The color values are in the RGBA formand the interpolation is linear.

Appendix D. Visualizing

UsageAtomsviewerav file

DescriptionThe Atomsviewer program will read an Atoms

viewer file and visualize it. When the programfirst launched, it will create a blank window, whicwill display the visualization, and a console windothat will display various messages associated withgraphical rendering. To start the program, go torendering window and press the letter ‘o’. This wallow the user to enter the name of the Atomsviewfile that they wish to visualize. Enter the full path

the file and press enter. If the file is successfully reby the program, the atomic data will be drawn. Dferent keys on the keyboard are used to control difent functions of the program such as camera moment, animating the entire dataset, taking snapsetc. These commands are shown inFig. 6.

The following set of commands can be usedspecify various parameters of a given visualizatiThese include the size and color of the atomic repsentations, label specifiers, etc. These commandsbe grouped in a configuration file or are entered at rtime.

BACKGROUND_COLOR< r,g, b, a > Specify thebackground color of the window in the RGBformat. The values ofr, g, b anda, specifythe red, green, blue and alpha componentthe color, respectively, and lie between 0and 1.0.

BOX Toggle the display of the two boundinboxes.

CAM_DIR < w′, x ′, y ′, z′ > This command allowsthe user to specify the orientation of the caera. This is useful to recreate a particuorientation when viewing multiple files orecord a series of camera orientations acreate an animation of an exploration ofvisualized system.w′, x ′, y ′, z′ specify theorientation as a quaternion[13].

CAM_POS< x,y, z > This command allows thuser to specify the position of the cameThis is useful to recreate a particular positiwhen viewing multiple files or record a seriof camera positions and create an animatof a walkthrough in a visualized system.

CAM_P_D< x,y, z,w′, x ′, y ′, z′ > This commandallows the user to simultaneously specify tcamera position and orientation. A seriesthese commands are used to record and reate a walkthrough of a visualized system.

CLIPPING_PLANE< f > Set the clipping plane tothe value specified byf .

COMMANDS Display the list of possible commandon the console with a brief description.

EXIT Quit the program.FONT_COLOR< r,g, b, a > Specify the color of

the font, which will be used in the displawindow, in an RGBA format. The values o

Page 11: Scalable and portable visualization of large atomistic ...cacs.usc.edu/papers/Sharma-viz-CPC04.pdfScalable and portable visualization of large atomistic datasets Ashish Sharma∗,

A. Sharma et al. / Computer Physics Communications 163 (2004) 53–64 63

Fig. 6. Frequently used commands of Atomsviewer.

dly,

ede-lti--

ach

len

-he

e

e

te

nd

r

o-is an-d

isr

a

r, g, b anda, specify the red, green, blue analpha component of the color, respectiveand lie between 0.0 and 1.0.

FRAME < f > Jump to framef .FRAME_LABEL < f, s > The frame label can b

used to specify a tag that can be used toscribe the image being visualized. In a muframe visualization, this label could for example describe the time associated with eframe.

FRAME_LABEL_START< f > This is useful onlyin a multi-frame visualization, where it wilindicate the value that will be displayed whvisualizing the first frame.

FRAME_LABEL_STEP< f > This is useful onlyin a multi-frame visualization. This value indicates the increment that will be used in tlabel display of subsequent frames.

HIDE_SPECIES< i, j > Hide species fromi to j ,wherei � j .

LOAD_AV_FILE < s > Load the Atomsviewer file(with the extension .av) specified by thstrings.

LOAD_CFG_FILE< s > Load the configuration file(with the extension .cfg) specified by thstrings.

LOAD_GRADIENT < s > Load the color gradienfile (with the extension .col) specified by thstrings.

ORIGIN Return the camera to its default position aorientation.

SPECIES_COLOR< i, r, g, b, a > This lets a useset the color of a speciei (an integer) as anrgba quadruple, where each color compnent is a float value between 0 and 1. Thiscommand that should be included in all cofiguration files. The configuration file createby the file converter program will have thcommand in it, but with certain default colovalues.

SPECIES_RADIUS< i, r > This sets the radius ofspeciei (an integer) to a float valuer. All

Page 12: Scalable and portable visualization of large atomistic ...cacs.usc.edu/papers/Sharma-viz-CPC04.pdfScalable and portable visualization of large atomistic datasets Ashish Sharma∗,

64 A. Sharma et al. / Computer Physics Communications 163 (2004) 53–64

anro-

nn inu-

Deup

ttleces

ta,ms

,(5)

lti-put.

r

,-s,(1)

o-.

ce

er,uret

ro-A,

r

es,

atoms default to a radius of 1, and a user cuse this command to draw the atoms at pportional radii.

SHOW_SPECIES< i, j > Show species fromi to j ,wherei � j .

References

[1] C.L. Rountree, R.K. Kalia, E. Lidorikis, A. Nakano, L. VaBrutzel, P. Vashishta, Atomistic aspects of crack propagatiobrittle materials: multimillion atom molecular dynamics simlations, Annual Review of Materials Research (2002).

[2] F.F. Abraham, R. Walkup, H.J. Gao, M. Duchaineau, T.D.la Rubia, M. Seager, Simulating materials failure by usingto one billion atoms and the world’s fastest computer: Brifracture, in: Proceedings of the National Academy of Scienof the United States of America, 2002.

[3] A. Nakano, R.K. Kalia, P. Vashishta, T.J. Campbell, S. OgaF. Shimojo, S. Saini, Scalable atomistic simulation algorithfor materials research, Scientific Programming 10 (2002).

[4] A. Nakano, J.X. Chen, High-dimensional data acquisitioncomputing, and visualization, Comput. Sci. Engrg. 5(2003).

[5] A. Sharma, R.K. Kalia, A. Nakano, P. Vashishta, Large mudimensional data visualization for materials science, ComSci. Engrg. 5 (2) (2003).

[6] W. Humphrey, A. Dalke, K. Schulten, VMD: visual moleculadynamics, J. Molecular Graphics 14 (1) (1996).

[7] A. Sharma, A. Nakano, R.K. Kalia, P. Vashishta, S. KodiyalamP. Miller, W. Zhao, X.L. Liu, T.J. Campbell, A. Haas, Immersive and interactive exploration of billion-atom systemPresence—Teleoperators and Virtual Environments 12(2003).

[8] I. Szlufarska, R.K. Kalia, A. Nakano, P. Vashishta, Nanindentation-induced amorphization in silicon carbide, ApplPhys. Lett., submitted for publication.

[9] J.H. Clark, Hierarchical geometric models for visible surfaalgorithms, Commun. ACM 19 (10) (1976).

[10] D.V. Pinsky, J. Meyer, B. Hamann, K.I. Joy, E.S. BruggM.A. Duchaineau, An error-controlled octree data structfor large-scale visualization,Crossroads—The ACM StudenMagazine (spring 2000).

[11] M. Woo, J. Neider, T. Davis, D. Shreiner, The OpenGL Pgramming Guide, third ed., Addison–Wesley, Reading, M1999.

[12] GNU Image Manipulation Program (GIMP), available undeGPL fromhttp://www.gimp.org.

[13] K. Shoemake, Animating rotation with quaternion curvACM SIGGRAPH Computer Graphics 19 (3) (1985).