Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*----------------------------------------------------------------------
SerialReax - Reax Force Field Simulator
Copyright (2010) Purdue University
Hasan Metin Aktulga, haktulga@cs.purdue.edu
Joseph Fogarty, jcfogart@mail.usf.edu
Sagar Pandit, pandit@usf.edu
Ananth Y Grama, ayg@cs.purdue.edu
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details:
<http://www.gnu.org/licenses/>.
----------------------------------------------------------------------*/
#include <stdio.h>
#include <stdlib.h>
#include "puremd.h"
#define INVALID_INPUT (-1)
static void usage( char * argv[] )
{
fprintf( stderr, "usage: ./%s geometry_file force_field_params_file control_file\n", argv[0] );
}
int main( int argc, char* argv[] )
{
void *handle;
int ret;
MPI_Init( &argc, &argv );
if ( argc != 4 )
{
usage( argv );
MPI_Abort( MPI_COMM_WORLD, INVALID_INPUT );
}
handle = setup( argv[1], argv[2], argv[3] );
ret = PUREMD_FAILURE;
if ( handle != NULL )
{
ret = simulate( handle );
}
MPI_Finalized( &ret );
if ( !ret )
{
MPI_Finalize( );
}
if ( ret == PUREMD_SUCCESS )
{
ret = cleanup( handle );
}
return (ret == PUREMD_SUCCESS) ? 0 : (-1);
}