CoMD
A Mini-app for Co-Design of Classical Molecular Dynamics.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
CoMD.c File Reference

Main program. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <unistd.h>
#include <assert.h>
#include "CoMDTypes.h"
#include "decomposition.h"
#include "linkCells.h"
#include "eam.h"
#include "ljForce.h"
#include "initAtoms.h"
#include "memUtils.h"
#include "yamlOutput.h"
#include "parallel.h"
#include "performanceTimers.h"
#include "mycommand.h"
#include "timestep.h"
#include "constants.h"
Include dependency graph for CoMD.c:

Go to the source code of this file.

Macros

#define REDIRECT_OUTPUT   0
 
#define MIN(A, B)   ((A) < (B) ? (A) : (B))
 

Functions

static SimFlatinitSimulation (Command cmd)
 Initialized the main CoMD data stucture, SimFlat, based on command line input from the user. More...
 
static void destroySimulation (SimFlat **ps)
 frees all data associated with *ps and frees *ps More...
 
static void initSubsystems (void)
 
static void finalizeSubsystems (void)
 
static BasePotentialinitPotential (int doeam, const char *potDir, const char *potName, const char *potType)
 decide whether to get LJ or EAM potentials More...
 
static SpeciesDatainitSpecies (BasePotential *pot)
 
static ValidateinitValidate (SimFlat *s)
 
static void validateResult (const Validate *val, SimFlat *sim)
 
static void sumAtoms (SimFlat *s)
 
static void printThings (SimFlat *s, int iStep, double elapsedTime)
 Prints current time, energy, performance etc to monitor the state of the running simulation. More...
 
static void printSimulationDataYaml (FILE *file, SimFlat *s)
 Print information about the simulation in a format that is (mostly) YAML compliant. More...
 
static void sanityChecks (Command cmd, double cutoff, double latticeConst, char latticeType[8])
 Check that the user input meets certain criteria. More...
 
int main (int argc, char **argv)
 

Detailed Description

Main program.

Definition in file CoMD.c.

Macro Definition Documentation

#define MIN (   A,
 
)    ((A) < (B) ? (A) : (B))

Definition at line 64 of file CoMD.c.

#define REDIRECT_OUTPUT   0

Definition at line 63 of file CoMD.c.

Function Documentation

void destroySimulation ( SimFlat **  ps)
static

frees all data associated with *ps and frees *ps

Definition at line 217 of file CoMD.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void finalizeSubsystems ( void  )
static

Definition at line 244 of file CoMD.c.

Here is the call graph for this function:

Here is the caller graph for this function:

BasePotential * initPotential ( int  doeam,
const char *  potDir,
const char *  potName,
const char *  potType 
)
static

decide whether to get LJ or EAM potentials

Definition at line 253 of file CoMD.c.

Here is the call graph for this function:

Here is the caller graph for this function:

SimFlat * initSimulation ( Command  cmd)
static

Initialized the main CoMD data stucture, SimFlat, based on command line input from the user.

Also performs certain sanity checks on the input to screen out certain non-sensical inputs.

Simple data members such as the time step dt are initialized directly, substructures such as the potential, the link cells, the atoms, etc., are initialized by calling additional initialization functions (initPotential(), initLinkCells(), initAtoms(), etc.). Initialization order is set by the natural dependencies of the substructure such as the atoms need the link cells so the link cells must be initialized before the atoms.

Definition at line 161 of file CoMD.c.

Here is the call graph for this function:

Here is the caller graph for this function:

SpeciesData * initSpecies ( BasePotential pot)
static

Definition at line 266 of file CoMD.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void initSubsystems ( void  )
static

Definition at line 235 of file CoMD.c.

Here is the call graph for this function:

Here is the caller graph for this function:

Validate * initValidate ( SimFlat s)
static

Definition at line 277 of file CoMD.c.

Here is the call graph for this function:

Here is the caller graph for this function:

int main ( int  argc,
char **  argv 
)

Definition at line 84 of file CoMD.c.

Here is the call graph for this function:

void printSimulationDataYaml ( FILE *  file,
SimFlat s 
)
static

Print information about the simulation in a format that is (mostly) YAML compliant.

Definition at line 377 of file CoMD.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void printThings ( SimFlat s,
int  iStep,
double  elapsedTime 
)
static

Prints current time, energy, performance etc to monitor the state of the running simulation.

Performance per atom is scaled by the number of local atoms per process this should give consistent timing assuming reasonable load balance

Definition at line 342 of file CoMD.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void sanityChecks ( Command  cmd,
double  cutoff,
double  latticeConst,
char  latticeType[8] 
)
static

Check that the user input meets certain criteria.

Definition at line 416 of file CoMD.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void sumAtoms ( SimFlat s)
static

Definition at line 324 of file CoMD.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void validateResult ( const Validate val,
SimFlat sim 
)
static

Definition at line 295 of file CoMD.c.

Here is the call graph for this function:

Here is the caller graph for this function: