integrate MDI wrapper directly into main.cpp
we can remove the header, since this dummy interface should not be used elsewhere.
This commit is contained in:
36
src/main.cpp
36
src/main.cpp
@ -14,7 +14,6 @@
|
||||
#include "lammps.h"
|
||||
|
||||
#include "input.h"
|
||||
#include "mdi_interface.h"
|
||||
|
||||
#include <cstdlib>
|
||||
#include <mpi.h>
|
||||
@ -27,6 +26,41 @@
|
||||
#include "exceptions.h"
|
||||
#endif
|
||||
|
||||
// import real or dummy calls to MolSSI Driver Interface library
|
||||
#if defined(LMP_USER_MDI)
|
||||
|
||||
// true interface to MDI
|
||||
#include <mdi.h>
|
||||
|
||||
#else
|
||||
|
||||
// dummy interface to MDI
|
||||
// needed for compiling when MDI is not installed
|
||||
|
||||
typedef int MDI_Comm;
|
||||
static int MDI_Init(int *argc, char ***argv)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static int MDI_Initialized(int *flag)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static int MDI_MPI_get_world_comm(void *world_comm)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static int MDI_Plugin_get_argc(int *argc)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static int MDI_Plugin_get_argv(char ***argv)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
|
||||
@ -1,37 +0,0 @@
|
||||
/* -*- c++ -*- ----------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
http://lammps.sandia.gov, Sandia National Laboratories
|
||||
Steve Plimpton, sjplimp@sandia.gov
|
||||
|
||||
Copyright (2003) Sandia Corporation. Under the terms of Contract
|
||||
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
|
||||
certain rights in this software. This software is distributed under
|
||||
the GNU General Public License.
|
||||
|
||||
See the README file in the top-level LAMMPS directory.
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#ifndef LMP_MDI_INTERFACE_H
|
||||
#define LMP_MDI_INTERFACE_H
|
||||
|
||||
#if defined(LMP_USER_MDI)
|
||||
|
||||
// true interface to MDI
|
||||
// used when MDI is installed
|
||||
|
||||
#include "mdi.h"
|
||||
|
||||
#else
|
||||
|
||||
// dummy interface to MDI
|
||||
// needed for compiling when MDI is not installed
|
||||
|
||||
typedef int MDI_Comm;
|
||||
inline int MDI_Init(int* argc, char ***argv) {return 0;};
|
||||
inline int MDI_Initialized(int* flag) {return 0;};
|
||||
inline int MDI_MPI_get_world_comm(void* world_comm) {return 0;};
|
||||
inline int MDI_Plugin_get_argc(int* argc) {return 0;};
|
||||
inline int MDI_Plugin_get_argv(char*** argv) {return 0;};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
Reference in New Issue
Block a user