@ -187,10 +187,17 @@ added forces to be included in the total potential energy of the
|
|||||||
system (the quantity being minimized), you MUST enable the
|
system (the quantity being minimized), you MUST enable the
|
||||||
"fix_modify"_fix_modify.html {energy} option for this fix.
|
"fix_modify"_fix_modify.html {energy} option for this fix.
|
||||||
|
|
||||||
This fix computes a global scalar, which can be accessed by various
|
This fix computes a global scalar and a global vector of length 3, which
|
||||||
"output commands"_Section_howto.html#howto_15. The scalar is the
|
can be accessed by various "output commands"_Section_howto.html#howto_15.
|
||||||
potential energy for all the restraints as discussed above. The scalar
|
The scalar is the total potential energy for {all} the restraints as
|
||||||
value calculated by this fix is "extensive".
|
discussed above. The vector values are the sum of contributions to the
|
||||||
|
following individual categories:
|
||||||
|
|
||||||
|
1 = bond energy
|
||||||
|
2 = angle energy
|
||||||
|
3 = dihedral energy :ul
|
||||||
|
|
||||||
|
The scalar and vector values calculated by this fix are "extensive".
|
||||||
|
|
||||||
No parameter of this fix can be used with the {start/stop} keywords of
|
No parameter of this fix can be used with the {start/stop} keywords of
|
||||||
the "run"_run.html command.
|
the "run"_run.html command.
|
||||||
|
|||||||
@ -2015,8 +2015,8 @@ pecified
|
|||||||
LammpsInterface::instance()->int_allmax(&send_size,&max_size);
|
LammpsInterface::instance()->int_allmax(&send_size,&max_size);
|
||||||
|
|
||||||
if (comm_rank == 0) {
|
if (comm_rank == 0) {
|
||||||
int intbuf[max_size];
|
int *intbuf = new int[max_size];
|
||||||
double buf[max_size];
|
double *buf = new double[max_size];
|
||||||
for (int iproc = 1; iproc < nprocs; iproc++) {
|
for (int iproc = 1; iproc < nprocs; iproc++) {
|
||||||
LammpsInterface::instance()->int_recv(intbuf,max_size,iproc);
|
LammpsInterface::instance()->int_recv(intbuf,max_size,iproc);
|
||||||
LammpsInterface::instance()->recv(buf,max_size,iproc);
|
LammpsInterface::instance()->recv(buf,max_size,iproc);
|
||||||
@ -2024,15 +2024,19 @@ pecified
|
|||||||
out << intbuf[i] << " " << buf[i] << "\n";
|
out << intbuf[i] << " " << buf[i] << "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
delete[] intbuf;
|
||||||
|
delete[] buf;
|
||||||
} else {
|
} else {
|
||||||
int intbuf[send_size];
|
int *intbuf = new int[send_size];
|
||||||
double buf[send_size];
|
double *buf = new double[send_size];
|
||||||
for (int i = 0; i < send_size; i++) {
|
for (int i = 0; i < send_size; i++) {
|
||||||
intbuf[i] = id2tag[i];
|
intbuf[i] = id2tag[i];
|
||||||
buf[i] = atomicVolumeMatrix(i,i);
|
buf[i] = atomicVolumeMatrix(i,i);
|
||||||
}
|
}
|
||||||
LammpsInterface::instance()->int_send(intbuf,send_size);
|
LammpsInterface::instance()->int_send(intbuf,send_size);
|
||||||
LammpsInterface::instance()->send(buf,send_size);
|
LammpsInterface::instance()->send(buf,send_size);
|
||||||
|
delete[] intbuf;
|
||||||
|
delete[] buf;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <stdio.h>
|
#include <cstdio>
|
||||||
|
|
||||||
// for macros
|
// for macros
|
||||||
#include "MatrixDef.h"
|
#include "MatrixDef.h"
|
||||||
|
|||||||
@ -2,10 +2,9 @@
|
|||||||
#define ARRAY2D_H
|
#define ARRAY2D_H
|
||||||
|
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
#include <cstdio>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cstdlib>
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
#include "Array.h"
|
#include "Array.h"
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
|
|
||||||
using ATC_Utility::command_line;
|
using ATC_Utility::command_line;
|
||||||
using ATC_Utility::str2dbl;
|
using ATC_Utility::str2dbl;
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
#include "Utility.h"
|
#include "Utility.h"
|
||||||
|
|
||||||
// Other headers
|
// Other headers
|
||||||
#include "math.h"
|
#include <cmath>
|
||||||
|
|
||||||
using ATC_Utility::dbl_geq;
|
using ATC_Utility::dbl_geq;
|
||||||
using ATC_Utility::det3;
|
using ATC_Utility::det3;
|
||||||
|
|||||||
@ -7,8 +7,8 @@
|
|||||||
#include "KernelFunction.h"
|
#include "KernelFunction.h"
|
||||||
#include "Utility.h"
|
#include "Utility.h"
|
||||||
#include "MPI_Wrappers.h"
|
#include "MPI_Wrappers.h"
|
||||||
#include <stdio.h>
|
#include <cstdio>
|
||||||
#include <stdlib.h>
|
#include <cstdlib>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
@ -352,8 +352,9 @@ namespace ATC{
|
|||||||
// each segment of the piecewise funcion is length-normalized separately
|
// each segment of the piecewise funcion is length-normalized separately
|
||||||
else if (strcmp(arg[argIdx],"position-number-density")==0) {
|
else if (strcmp(arg[argIdx],"position-number-density")==0) {
|
||||||
argIdx++;
|
argIdx++;
|
||||||
double y[nx],w[nx];
|
double *y = new double[nx];
|
||||||
int n[nx];
|
double *w = new double[nx];
|
||||||
|
int *n = new int[nx];
|
||||||
int nn = 0;
|
int nn = 0;
|
||||||
while (argIdx < narg) {
|
while (argIdx < narg) {
|
||||||
if (! is_numeric(arg[argIdx])) break;
|
if (! is_numeric(arg[argIdx])) break;
|
||||||
@ -369,7 +370,7 @@ namespace ATC{
|
|||||||
double w0 = w[i-1];
|
double w0 = w[i-1];
|
||||||
double dw = w[i]-w0;
|
double dw = w[i]-w0;
|
||||||
double lx = 0;
|
double lx = 0;
|
||||||
double l[dn];
|
double *l = new double[dn];
|
||||||
for (int j = 0; j < dn; ++j) {
|
for (int j = 0; j < dn; ++j) {
|
||||||
double x = (j+0.5)/dn;
|
double x = (j+0.5)/dn;
|
||||||
double dl = w0+x*dw;
|
double dl = w0+x*dw;
|
||||||
@ -380,7 +381,11 @@ namespace ATC{
|
|||||||
for (int j = 0; j < dn; ++j) {
|
for (int j = 0; j < dn; ++j) {
|
||||||
dx(k++) = scale*l[j];
|
dx(k++) = scale*l[j];
|
||||||
}
|
}
|
||||||
|
delete[] l;
|
||||||
}
|
}
|
||||||
|
delete[] y;
|
||||||
|
delete[] w;
|
||||||
|
delete[] n;
|
||||||
}
|
}
|
||||||
// construct relative values from a density function
|
// construct relative values from a density function
|
||||||
// evaluate for a domain (0,1)
|
// evaluate for a domain (0,1)
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
#include "FE_Quadrature.h"
|
#include "FE_Quadrature.h"
|
||||||
|
|
||||||
// Other headers
|
// Other headers
|
||||||
#include "math.h"
|
#include <cmath>
|
||||||
|
|
||||||
using std::map;
|
using std::map;
|
||||||
using std::vector;
|
using std::vector;
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
#include "OutputManager.h"
|
#include "OutputManager.h"
|
||||||
#include "Utility.h"
|
#include "Utility.h"
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <assert.h>
|
#include <cassert>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
|||||||
@ -12,7 +12,7 @@
|
|||||||
#include <map>
|
#include <map>
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <float.h>
|
#include <cfloat>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "mpi.h"
|
#include "mpi.h"
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#include <alloca.h>
|
||||||
#include "Function.h"
|
#include "Function.h"
|
||||||
#include "ATC_Error.h"
|
#include "ATC_Error.h"
|
||||||
#include "LammpsInterface.h"
|
#include "LammpsInterface.h"
|
||||||
@ -58,7 +59,7 @@ namespace ATC {
|
|||||||
{
|
{
|
||||||
string type = args[0];
|
string type = args[0];
|
||||||
int narg = nargs -1;
|
int narg = nargs -1;
|
||||||
double dargs[narg];
|
double *dargs = alloca(sizeof(double) * narg);
|
||||||
for (int i = 0; i < narg; ++i) dargs[i] = atof(args[i+1]);
|
for (int i = 0; i < narg; ++i) dargs[i] = atof(args[i+1]);
|
||||||
|
|
||||||
return function(type, narg, dargs);
|
return function(type, narg, dargs);
|
||||||
@ -192,7 +193,7 @@ XT_Function_Mgr * XT_Function_Mgr::myInstance_ = NULL;
|
|||||||
{
|
{
|
||||||
string type = args[0];
|
string type = args[0];
|
||||||
int narg = nargs -1;
|
int narg = nargs -1;
|
||||||
double dargs[narg];
|
double *dargs = alloca(sizeof(double) * narg);
|
||||||
for (int i = 0; i < narg; ++i) dargs[i] = atof(args[i+1]);
|
for (int i = 0; i < narg; ++i) dargs[i] = atof(args[i+1]);
|
||||||
|
|
||||||
return function(type, narg, dargs);
|
return function(type, narg, dargs);
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#ifndef XT_FUNCTION_H
|
#ifndef XT_FUNCTION_H
|
||||||
#define XT_FUNCTION_H
|
#define XT_FUNCTION_H
|
||||||
|
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
|||||||
@ -19,7 +19,7 @@
|
|||||||
//
|
//
|
||||||
//*****************************************************************
|
//*****************************************************************
|
||||||
|
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
|
|
||||||
|
|
||||||
template<class Real>
|
template<class Real>
|
||||||
|
|||||||
@ -279,7 +279,7 @@ namespace ATC {
|
|||||||
typename std::map<std::string,data * >::iterator it = list.find(tag);
|
typename std::map<std::string,data * >::iterator it = list.find(tag);
|
||||||
if (it==list.end()) return NULL;
|
if (it==list.end()) return NULL;
|
||||||
return it->second;
|
return it->second;
|
||||||
};
|
}
|
||||||
|
|
||||||
/** helper function to add a data entry to a list */
|
/** helper function to add a data entry to a list */
|
||||||
template <typename data>
|
template <typename data>
|
||||||
@ -290,7 +290,7 @@ namespace ATC {
|
|||||||
throw ATC_Error("Tried to add another Quantity with tag "+tag+" in InterscaleManager::add_quantity");
|
throw ATC_Error("Tried to add another Quantity with tag "+tag+" in InterscaleManager::add_quantity");
|
||||||
typename std::template pair<std::string,data * > myPair(tag,quantity);
|
typename std::template pair<std::string,data * > myPair(tag,quantity);
|
||||||
list.insert(myPair);
|
list.insert(myPair);
|
||||||
};
|
}
|
||||||
|
|
||||||
/** helper function to add a data entry to a list when it requires neighbor communication*/
|
/** helper function to add a data entry to a list when it requires neighbor communication*/
|
||||||
template <typename data>
|
template <typename data>
|
||||||
@ -302,7 +302,7 @@ namespace ATC {
|
|||||||
if (quantity->atom_type() == PROC_GHOST) {
|
if (quantity->atom_type() == PROC_GHOST) {
|
||||||
commList.push_back(quantity);
|
commList.push_back(quantity);
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
/** helper function to fina a data entry in a list */
|
/** helper function to fina a data entry in a list */
|
||||||
template <typename data>
|
template <typename data>
|
||||||
@ -311,7 +311,7 @@ namespace ATC {
|
|||||||
typename std::map<std::string,data * >::iterator it = list.find(tag);
|
typename std::map<std::string,data * >::iterator it = list.find(tag);
|
||||||
if (it!=list.end()) return it->second;
|
if (it!=list.end()) return it->second;
|
||||||
return NULL;
|
return NULL;
|
||||||
};
|
}
|
||||||
|
|
||||||
/** helper function to force the reset of all data in a list */
|
/** helper function to force the reset of all data in a list */
|
||||||
template <typename data>
|
template <typename data>
|
||||||
@ -319,7 +319,7 @@ namespace ATC {
|
|||||||
{
|
{
|
||||||
for (typename std::map<std::string,data* >::iterator it = list.begin(); it != list.end(); ++it)
|
for (typename std::map<std::string,data* >::iterator it = list.begin(); it != list.end(); ++it)
|
||||||
(it->second)->force_reset();
|
(it->second)->force_reset();
|
||||||
};
|
}
|
||||||
|
|
||||||
/** helper function to set the memory type to temporary of a list */
|
/** helper function to set the memory type to temporary of a list */
|
||||||
template <typename data>
|
template <typename data>
|
||||||
@ -327,7 +327,7 @@ namespace ATC {
|
|||||||
{
|
{
|
||||||
for (typename std::map<std::string,data* >::iterator it = list.begin(); it != list.end(); ++it)
|
for (typename std::map<std::string,data* >::iterator it = list.begin(); it != list.end(); ++it)
|
||||||
(it->second)->set_memory_type(TEMPORARY);
|
(it->second)->set_memory_type(TEMPORARY);
|
||||||
};
|
}
|
||||||
|
|
||||||
/** helper function to perform intialization for dfs of a list */
|
/** helper function to perform intialization for dfs of a list */
|
||||||
template <typename data>
|
template <typename data>
|
||||||
@ -336,7 +336,7 @@ namespace ATC {
|
|||||||
for (typename std::map<std::string,data* >::iterator it = list.begin(); it != list.end(); ++it) {
|
for (typename std::map<std::string,data* >::iterator it = list.begin(); it != list.end(); ++it) {
|
||||||
(it->second)->dfsFound_ = false;
|
(it->second)->dfsFound_ = false;
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
/** helper function to start the dfs visit for list */
|
/** helper function to start the dfs visit for list */
|
||||||
template <typename data>
|
template <typename data>
|
||||||
@ -349,7 +349,7 @@ namespace ATC {
|
|||||||
if ((it->second)->memory_type()==TEMPORARY) list.erase(it++);
|
if ((it->second)->memory_type()==TEMPORARY) list.erase(it++);
|
||||||
else ++it;
|
else ++it;
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
// PAQ helper functions
|
// PAQ helper functions
|
||||||
/** helper function to adjust local atom count for all data in a list before exchange, only valid with quantities that do that are aware of atom counts */
|
/** helper function to adjust local atom count for all data in a list before exchange, only valid with quantities that do that are aware of atom counts */
|
||||||
@ -359,7 +359,7 @@ namespace ATC {
|
|||||||
for (typename std::map<std::string,data* >::iterator it = list.begin(); it != list.end(); ++it) {
|
for (typename std::map<std::string,data* >::iterator it = list.begin(); it != list.end(); ++it) {
|
||||||
(it->second)->reset_nlocal();
|
(it->second)->reset_nlocal();
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
/** helper function to indicate lammps data is stale for all data in a list before exchange, only valid with PAQs */
|
/** helper function to indicate lammps data is stale for all data in a list before exchange, only valid with PAQs */
|
||||||
template <typename data>
|
template <typename data>
|
||||||
@ -367,7 +367,7 @@ namespace ATC {
|
|||||||
{
|
{
|
||||||
for (typename std::map<std::string,data* >::iterator it = list.begin(); it != list.end(); ++it)
|
for (typename std::map<std::string,data* >::iterator it = list.begin(); it != list.end(); ++it)
|
||||||
(it->second)->lammps_force_reset();
|
(it->second)->lammps_force_reset();
|
||||||
};
|
}
|
||||||
|
|
||||||
/** helper function to size all data in a list, only valid with comm lists */
|
/** helper function to size all data in a list, only valid with comm lists */
|
||||||
template <typename data>
|
template <typename data>
|
||||||
@ -375,7 +375,7 @@ namespace ATC {
|
|||||||
{
|
{
|
||||||
for (typename std::vector<data* >::iterator it = list.begin(); it != list.end(); ++it)
|
for (typename std::vector<data* >::iterator it = list.begin(); it != list.end(); ++it)
|
||||||
(*it)->quantity();
|
(*it)->quantity();
|
||||||
};
|
}
|
||||||
|
|
||||||
/** helper function to pack all data in a list before exchange, only valid with quantities that do work before parallel communication */
|
/** helper function to pack all data in a list before exchange, only valid with quantities that do work before parallel communication */
|
||||||
template <typename data>
|
template <typename data>
|
||||||
@ -384,7 +384,7 @@ namespace ATC {
|
|||||||
for (typename std::map<std::string,data* >::iterator it = list.begin(); it != list.end(); ++it) {
|
for (typename std::map<std::string,data* >::iterator it = list.begin(); it != list.end(); ++it) {
|
||||||
(it->second)->prepare_exchange();
|
(it->second)->prepare_exchange();
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
/** helper function to extract all data in a list after exchange, only valid with quantities that do work after parallel communication */
|
/** helper function to extract all data in a list after exchange, only valid with quantities that do work after parallel communication */
|
||||||
template <typename data>
|
template <typename data>
|
||||||
@ -393,7 +393,7 @@ namespace ATC {
|
|||||||
for (typename std::map<std::string,data* >::iterator it = list.begin(); it != list.end(); ++it) {
|
for (typename std::map<std::string,data* >::iterator it = list.begin(); it != list.end(); ++it) {
|
||||||
(it->second)->post_exchange();
|
(it->second)->post_exchange();
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
/** helper function to determine memory usage of all data in a list, only valid with PAQs */
|
/** helper function to determine memory usage of all data in a list, only valid with PAQs */
|
||||||
template <typename data>
|
template <typename data>
|
||||||
@ -401,7 +401,7 @@ namespace ATC {
|
|||||||
{
|
{
|
||||||
for (typename std::map<std::string,data* >::const_iterator it = list.begin(); it != list.end(); ++it)
|
for (typename std::map<std::string,data* >::const_iterator it = list.begin(); it != list.end(); ++it)
|
||||||
usage += (it->second)->memory_usage();
|
usage += (it->second)->memory_usage();
|
||||||
};
|
}
|
||||||
|
|
||||||
/** helper function to pack arrays of all data before exchange in a list, only valid with PAQs */
|
/** helper function to pack arrays of all data before exchange in a list, only valid with PAQs */
|
||||||
template <typename data>
|
template <typename data>
|
||||||
@ -410,7 +410,7 @@ namespace ATC {
|
|||||||
for (typename std::map<std::string,data* >::iterator it = list.begin(); it != list.end(); ++it) {
|
for (typename std::map<std::string,data* >::iterator it = list.begin(); it != list.end(); ++it) {
|
||||||
index += (it->second)->pack_exchange(i,&buffer[index]);
|
index += (it->second)->pack_exchange(i,&buffer[index]);
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
/** helper function to unpack arrays of all data after exchange in a list, only valid with PAQs */
|
/** helper function to unpack arrays of all data after exchange in a list, only valid with PAQs */
|
||||||
template <typename data>
|
template <typename data>
|
||||||
@ -418,7 +418,7 @@ namespace ATC {
|
|||||||
{
|
{
|
||||||
for (typename std::map<std::string,data* >::iterator it = list.begin(); it != list.end(); ++it)
|
for (typename std::map<std::string,data* >::iterator it = list.begin(); it != list.end(); ++it)
|
||||||
index += (it->second)->unpack_exchange(i,&buffer[index]);
|
index += (it->second)->unpack_exchange(i,&buffer[index]);
|
||||||
};
|
}
|
||||||
|
|
||||||
/** helper function to pack arrays of all data in a list, only valid with comm lists */
|
/** helper function to pack arrays of all data in a list, only valid with comm lists */
|
||||||
template <typename data>
|
template <typename data>
|
||||||
@ -427,7 +427,7 @@ namespace ATC {
|
|||||||
{
|
{
|
||||||
for (typename std::vector<data* >::iterator it = list.begin(); it != list.end(); ++it)
|
for (typename std::vector<data* >::iterator it = list.begin(); it != list.end(); ++it)
|
||||||
size += (*it)->pack_comm(index,&buf[size],pbc_flag,pbc);
|
size += (*it)->pack_comm(index,&buf[size],pbc_flag,pbc);
|
||||||
};
|
}
|
||||||
|
|
||||||
/** helper function to unpack arrays of all data in a list, only valid with comm lists */
|
/** helper function to unpack arrays of all data in a list, only valid with comm lists */
|
||||||
template <typename data>
|
template <typename data>
|
||||||
@ -435,7 +435,7 @@ namespace ATC {
|
|||||||
{
|
{
|
||||||
for (typename std::vector<data* >::iterator it = list.begin(); it != list.end(); ++it)
|
for (typename std::vector<data* >::iterator it = list.begin(); it != list.end(); ++it)
|
||||||
size += (*it)->unpack_comm(index,&buf[size]);
|
size += (*it)->unpack_comm(index,&buf[size]);
|
||||||
};
|
}
|
||||||
|
|
||||||
/** helper function to grow arrays of all data in a list, only valid with PAQs */
|
/** helper function to grow arrays of all data in a list, only valid with PAQs */
|
||||||
template <typename data>
|
template <typename data>
|
||||||
@ -443,7 +443,7 @@ namespace ATC {
|
|||||||
{
|
{
|
||||||
for (typename std::map<std::string,data* >::iterator it = list.begin(); it != list.end(); ++it)
|
for (typename std::map<std::string,data* >::iterator it = list.begin(); it != list.end(); ++it)
|
||||||
(it->second)->grow_lammps_array(nmax,prefix_+it->first);
|
(it->second)->grow_lammps_array(nmax,prefix_+it->first);
|
||||||
};
|
}
|
||||||
|
|
||||||
/** helper function to copy arrays of all data in a list, only valid with PAQs */
|
/** helper function to copy arrays of all data in a list, only valid with PAQs */
|
||||||
template <typename data>
|
template <typename data>
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#include "KD_Tree.h"
|
#include "KD_Tree.h"
|
||||||
#include <assert.h>
|
#include <cassert>
|
||||||
|
|
||||||
using std::vector;
|
using std::vector;
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
#include "Array2D.h"
|
#include "Array2D.h"
|
||||||
#include "MatrixDef.h"
|
#include "MatrixDef.h"
|
||||||
#include "MatrixLibrary.h"
|
#include "MatrixLibrary.h"
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#include "KernelFunction.h"
|
#include "KernelFunction.h"
|
||||||
#include "math.h"
|
#include <cmath>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "ATC_Error.h"
|
#include "ATC_Error.h"
|
||||||
#include "Quadrature.h"
|
#include "Quadrature.h"
|
||||||
|
|||||||
@ -131,15 +131,15 @@ void LammpsInterface::sparse_allsum(SparseMatrix<double> &toShare) const
|
|||||||
if (error != MPI_SUCCESS) throw ATC_Error("error in sparse_allsum_numrows "+to_string(error));
|
if (error != MPI_SUCCESS) throw ATC_Error("error in sparse_allsum_numrows "+to_string(error));
|
||||||
|
|
||||||
// adjust row sendcounts because recRowsCRS is off by one
|
// adjust row sendcounts because recRowsCRS is off by one
|
||||||
int rowCounts[nProcs];
|
int *rowCounts = new int[nProcs];
|
||||||
int sizeCounts[nProcs];
|
int *sizeCounts = new int[nProcs];
|
||||||
// set up total size of receive buffers for Allgatherv calls
|
// set up total size of receive buffers for Allgatherv calls
|
||||||
int totalRowsCRS = 0;
|
int totalRowsCRS = 0;
|
||||||
int totalSize = 0;
|
int totalSize = 0;
|
||||||
// set up array of displacements for Allgatherv calls
|
// set up array of displacements for Allgatherv calls
|
||||||
int rowOffsets[nProcs];
|
int *rowOffsets = new int[nProcs];
|
||||||
rowOffsets[0] = 0;
|
rowOffsets[0] = 0;
|
||||||
int sizeOffsets[nProcs];
|
int *sizeOffsets = new int[nProcs];
|
||||||
sizeOffsets[0] = 0;
|
sizeOffsets[0] = 0;
|
||||||
for (int i = 0; i < nProcs; i++) {
|
for (int i = 0; i < nProcs; i++) {
|
||||||
// find the total number of entries to share in the mpi calls below
|
// find the total number of entries to share in the mpi calls below
|
||||||
@ -156,8 +156,8 @@ void LammpsInterface::sparse_allsum(SparseMatrix<double> &toShare) const
|
|||||||
// get actual rows
|
// get actual rows
|
||||||
INDEX *rec_ia = new INDEX[totalRowsCRS];
|
INDEX *rec_ia = new INDEX[totalRowsCRS];
|
||||||
if (toShare.size() == 0) {
|
if (toShare.size() == 0) {
|
||||||
double dummy[0];
|
double dummy;
|
||||||
error = MPI_Allgatherv(dummy, 0, MPI_INT,
|
error = MPI_Allgatherv(&dummy, 0, MPI_INT,
|
||||||
rec_ia, rowCounts, rowOffsets, MPI_INT, lammps_->world);
|
rec_ia, rowCounts, rowOffsets, MPI_INT, lammps_->world);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -211,6 +211,10 @@ void LammpsInterface::sparse_allsum(SparseMatrix<double> &toShare) const
|
|||||||
toShare += tempMat;
|
toShare += tempMat;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
delete[] rowCounts;
|
||||||
|
delete[] sizeCounts;
|
||||||
|
delete[] rowOffsets;
|
||||||
|
delete[] sizeOffsets;
|
||||||
|
|
||||||
delete[] recInfo;
|
delete[] recInfo;
|
||||||
delete[] rec_ia;
|
delete[] rec_ia;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
#define LAMMPS_INTERFACE_H
|
#define LAMMPS_INTERFACE_H
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <stdlib.h>
|
#include <cstdlib>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <string>
|
#include <string>
|
||||||
@ -315,7 +315,7 @@ class LammpsInterface {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
int commSize = comm_size();
|
int commSize = comm_size();
|
||||||
double recv[commSize];
|
double *recv = new double[commSize];
|
||||||
MPI_Wrappers::gather(lammps_->world,data,recv);
|
MPI_Wrappers::gather(lammps_->world,data,recv);
|
||||||
if (rank_zero()) {
|
if (rank_zero()) {
|
||||||
full_msg << " ATC:" << tag;
|
full_msg << " ATC:" << tag;
|
||||||
@ -324,6 +324,7 @@ class LammpsInterface {
|
|||||||
}
|
}
|
||||||
full_msg << "\n";
|
full_msg << "\n";
|
||||||
}
|
}
|
||||||
|
delete[] recv;
|
||||||
}
|
}
|
||||||
if (rank_zero()) {
|
if (rank_zero()) {
|
||||||
std::string mesg = full_msg.str();
|
std::string mesg = full_msg.str();
|
||||||
@ -577,13 +578,13 @@ class LammpsInterface {
|
|||||||
void destroy_2d_int_array(int **i) const;
|
void destroy_2d_int_array(int **i) const;
|
||||||
int ** grow_2d_int_array(int **array, int n1, int n2, const char *name) const;
|
int ** grow_2d_int_array(int **array, int n1, int n2, const char *name) const;
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T * grow_array(T *&array, int n, const char *name) const {return lammps_->memory->grow(array,n,name);};
|
T * grow_array(T *&array, int n, const char *name) const {return lammps_->memory->grow(array,n,name);}
|
||||||
template <typename T>
|
template <typename T>
|
||||||
void destroy_array(T * array) {lammps_->memory->destroy(array);};
|
void destroy_array(T * array) {lammps_->memory->destroy(array);}
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T ** grow_array(T **&array, int n1, int n2, const char *name) const {return lammps_->memory->grow(array,n1,n2,name);};
|
T ** grow_array(T **&array, int n1, int n2, const char *name) const {return lammps_->memory->grow(array,n1,n2,name);}
|
||||||
template <typename T>
|
template <typename T>
|
||||||
void destroy_array(T ** array) const {lammps_->memory->destroy(array);};
|
void destroy_array(T ** array) const {lammps_->memory->destroy(array);}
|
||||||
/*@}*/
|
/*@}*/
|
||||||
|
|
||||||
/** \name Methods that interface with Update class */
|
/** \name Methods that interface with Update class */
|
||||||
|
|||||||
@ -94,7 +94,8 @@ namespace MPI_Wrappers {
|
|||||||
{
|
{
|
||||||
int myRank;
|
int myRank;
|
||||||
MPI_Comm_rank(MPI_COMM_WORLD, &myRank);
|
MPI_Comm_rank(MPI_COMM_WORLD, &myRank);
|
||||||
DOUBLE_RANK in[count],out[count];
|
DOUBLE_RANK *in = new DOUBLE_RANK[count];
|
||||||
|
DOUBLE_RANK *out = new DOUBLE_RANK[count];
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
in[i].val = send_buf[i];
|
in[i].val = send_buf[i];
|
||||||
in[i].rank = myRank;
|
in[i].rank = myRank;
|
||||||
@ -105,6 +106,8 @@ namespace MPI_Wrappers {
|
|||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
rec_buf[i] = out[i].val;
|
rec_buf[i] = out[i].val;
|
||||||
}
|
}
|
||||||
|
delete[] in;
|
||||||
|
delete[] out;
|
||||||
return out[0].rank;
|
return out[0].rank;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -154,14 +157,16 @@ namespace MPI_Wrappers {
|
|||||||
{
|
{
|
||||||
int error;
|
int error;
|
||||||
int numprocs = size(comm);
|
int numprocs = size(comm);
|
||||||
int sizes[numprocs];
|
int *sizes = new int[numprocs];
|
||||||
int displacements[numprocs];
|
int *displacements = new int[numprocs];
|
||||||
for (int i = 0; i < numprocs; ++i) {
|
for (int i = 0; i < numprocs; ++i) {
|
||||||
sizes[i] = 1;
|
sizes[i] = 1;
|
||||||
displacements[i] = i;
|
displacements[i] = i;
|
||||||
}
|
}
|
||||||
error = MPI_Scatterv(send_buf, sizes, displacements, MPI_INT, rec_buf, count, MPI_INT, 0, comm);
|
error = MPI_Scatterv(send_buf, sizes, displacements, MPI_INT, rec_buf, count, MPI_INT, 0, comm);
|
||||||
if (error != MPI_SUCCESS) throw ATC_Error("error in int_scatter "+to_string(error));
|
if (error != MPI_SUCCESS) throw ATC_Error("error in int_scatter "+to_string(error));
|
||||||
|
delete[] sizes;
|
||||||
|
delete[] displacements;
|
||||||
}
|
}
|
||||||
|
|
||||||
void allgatherv(MPI_Comm comm, double *send_buf, int send_count,
|
void allgatherv(MPI_Comm comm, double *send_buf, int send_count,
|
||||||
|
|||||||
@ -52,4 +52,4 @@ fastdep.exe: ../../src/DEPEND/fastdep.c
|
|||||||
clean:
|
clean:
|
||||||
-rm -f *.o *~ .depend $(LIB) fastdep.exe
|
-rm -f *.o *~ .depend $(LIB) fastdep.exe
|
||||||
|
|
||||||
sinclude $(DEPENDS)
|
sinclude .depend
|
||||||
|
|||||||
@ -1 +0,0 @@
|
|||||||
Makefile.mpi
|
|
||||||
@ -1,6 +1,6 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <stdio.h>
|
#include <cstdio>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include "OutputManager.h"
|
#include "OutputManager.h"
|
||||||
#include "ATC_Error.h"
|
#include "ATC_Error.h"
|
||||||
|
|||||||
@ -154,7 +154,7 @@ namespace ATC {
|
|||||||
std::set<int> fluxes;
|
std::set<int> fluxes;
|
||||||
//list of nodes to insert.
|
//list of nodes to insert.
|
||||||
//1 for nodes to insert, 0 for nodes not to insert.
|
//1 for nodes to insert, 0 for nodes not to insert.
|
||||||
int toInsert[nNodes_];
|
int *toInsert = new int[nNodes_];
|
||||||
for (int i = 0; i < nNodes_; ++i) toInsert[i] = 0;
|
for (int i = 0; i < nNodes_; ++i) toInsert[i] = 0;
|
||||||
|
|
||||||
const std::map < std::pair <int, int>, Array < XT_Function * > > & sources = faceSources_.find(thisField)->second;
|
const std::map < std::pair <int, int>, Array < XT_Function * > > & sources = faceSources_.find(thisField)->second;
|
||||||
@ -178,6 +178,7 @@ namespace ATC {
|
|||||||
for (int node = 0; node < nNodes_; ++node) {
|
for (int node = 0; node < nNodes_; ++node) {
|
||||||
if (toInsert[node]) fluxes.insert(node);
|
if (toInsert[node]) fluxes.insert(node);
|
||||||
}
|
}
|
||||||
|
delete[] toInsert;
|
||||||
return fluxes;
|
return fluxes;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -189,7 +190,7 @@ namespace ATC {
|
|||||||
{
|
{
|
||||||
//list of nodes to insert.
|
//list of nodes to insert.
|
||||||
//1 for nodes to insert, 0 for nodes not to insert.
|
//1 for nodes to insert, 0 for nodes not to insert.
|
||||||
int toInsert[nNodes_];
|
int *toInsert = new int[nNodes_];
|
||||||
for (int i = 0; i < nNodes_; ++i) toInsert[i] = 0;
|
for (int i = 0; i < nNodes_; ++i) toInsert[i] = 0;
|
||||||
|
|
||||||
const std::map < std::pair <int, int>, Array < XT_Function * > > & sources = faceSources_.find(thisField)->second;
|
const std::map < std::pair <int, int>, Array < XT_Function * > > & sources = faceSources_.find(thisField)->second;
|
||||||
@ -213,6 +214,7 @@ namespace ATC {
|
|||||||
for (int node = 0; node < nNodes_; ++node) {
|
for (int node = 0; node < nNodes_; ++node) {
|
||||||
if (toInsert[node]) fluxes.insert(node);
|
if (toInsert[node]) fluxes.insert(node);
|
||||||
}
|
}
|
||||||
|
delete[] toInsert;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** */
|
/** */
|
||||||
@ -223,7 +225,7 @@ namespace ATC {
|
|||||||
std::set<int> fluxes;
|
std::set<int> fluxes;
|
||||||
//list of nodes to insert.
|
//list of nodes to insert.
|
||||||
//1 for nodes to insert, 0 for nodes not to insert.
|
//1 for nodes to insert, 0 for nodes not to insert.
|
||||||
int toInsert[nNodes_];
|
int *toInsert = new int[nNodes_];
|
||||||
for (int i = 0; i < nNodes_; ++i) toInsert[i] = 0;
|
for (int i = 0; i < nNodes_; ++i) toInsert[i] = 0;
|
||||||
|
|
||||||
const Array2D < XT_Function *> & sources = elementSources_.find(thisField)->second;
|
const Array2D < XT_Function *> & sources = elementSources_.find(thisField)->second;
|
||||||
@ -244,6 +246,7 @@ namespace ATC {
|
|||||||
for (int node = 0; node < nNodes_; ++node) {
|
for (int node = 0; node < nNodes_; ++node) {
|
||||||
if (toInsert[node]) fluxes.insert(node);
|
if (toInsert[node]) fluxes.insert(node);
|
||||||
}
|
}
|
||||||
|
delete[] toInsert;
|
||||||
return fluxes;
|
return fluxes;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -255,7 +258,7 @@ namespace ATC {
|
|||||||
{
|
{
|
||||||
//list of nodes to insert.
|
//list of nodes to insert.
|
||||||
//1 for nodes to insert, 0 for nodes not to insert.
|
//1 for nodes to insert, 0 for nodes not to insert.
|
||||||
int toInsert[nNodes_];
|
int *toInsert = new int[nNodes_];
|
||||||
for (int i = 0; i < nNodes_; ++i) toInsert[i] = 0;
|
for (int i = 0; i < nNodes_; ++i) toInsert[i] = 0;
|
||||||
|
|
||||||
const Array2D < XT_Function *> & sources = elementSources_.find(thisField)->second;
|
const Array2D < XT_Function *> & sources = elementSources_.find(thisField)->second;
|
||||||
@ -276,6 +279,7 @@ namespace ATC {
|
|||||||
for (int node = 0; node < nNodes_; ++node) {
|
for (int node = 0; node < nNodes_; ++node) {
|
||||||
if (toInsert[node]) fluxes.insert(node);
|
if (toInsert[node]) fluxes.insert(node);
|
||||||
}
|
}
|
||||||
|
delete[] toInsert;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** */
|
/** */
|
||||||
|
|||||||
@ -5,10 +5,10 @@
|
|||||||
|
|
||||||
#include "DependencyManager.h"
|
#include "DependencyManager.h"
|
||||||
#include "PaqAtcUtility.h"
|
#include "PaqAtcUtility.h"
|
||||||
#include <map.h>
|
#include <map>
|
||||||
#include <vector.h>
|
#include <vector>
|
||||||
#include <set.h>
|
#include <set>
|
||||||
#include <pair.h>
|
#include <pair>
|
||||||
|
|
||||||
namespace ATC {
|
namespace ATC {
|
||||||
|
|
||||||
|
|||||||
@ -13,7 +13,7 @@
|
|||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include "math.h"
|
#include <cmath>
|
||||||
|
|
||||||
#include "ATC_Error.h"
|
#include "ATC_Error.h"
|
||||||
|
|
||||||
|
|||||||
@ -42,11 +42,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
//#include <math.h>
|
|
||||||
//#include <octave/oct.h>
|
|
||||||
|
|
||||||
//#include "f77-fcn.h"
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Abramowitz and Stegun: (eqn: 7.1.14) gives this continued
|
// Abramowitz and Stegun: (eqn: 7.1.14) gives this continued
|
||||||
// fraction for erfc(z)
|
// fraction for erfc(z)
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
# ifndef LOGEXC_H
|
# ifndef LOGEXC_H
|
||||||
# define LOGEXC_H
|
# define LOGEXC_H
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <cstdio>
|
||||||
#include <stdlib.h>
|
#include <cstdlib>
|
||||||
#include <stdarg.h>
|
#include <cstdarg>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
|||||||
@ -84,7 +84,7 @@
|
|||||||
# include <iostream>
|
# include <iostream>
|
||||||
# include <cmath>
|
# include <cmath>
|
||||||
# include <limits>
|
# include <limits>
|
||||||
# include <stdlib.h>
|
# include <cstdlib>
|
||||||
|
|
||||||
// some compilers don't define PI!
|
// some compilers don't define PI!
|
||||||
# ifndef M_PI
|
# ifndef M_PI
|
||||||
|
|||||||
@ -731,6 +731,6 @@ namespace UIestimator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
// Colvars repository at GitHub.
|
// Colvars repository at GitHub.
|
||||||
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <string.h>
|
#include <cstring>
|
||||||
|
|
||||||
#include "colvarmodule.h"
|
#include "colvarmodule.h"
|
||||||
#include "colvarparse.h"
|
#include "colvarparse.h"
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
// Colvars repository at GitHub.
|
// Colvars repository at GitHub.
|
||||||
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <string.h>
|
#include <cstring>
|
||||||
|
|
||||||
#if defined(_OPENMP)
|
#if defined(_OPENMP)
|
||||||
#include <omp.h>
|
#include <omp.h>
|
||||||
|
|||||||
@ -8,8 +8,7 @@
|
|||||||
// Colvars repository at GitHub.
|
// Colvars repository at GitHub.
|
||||||
|
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <stdlib.h>
|
#include <cstring>
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#define COLVARSCRIPT_CPP
|
#define COLVARSCRIPT_CPP
|
||||||
#include "colvarscript.h"
|
#include "colvarscript.h"
|
||||||
|
|||||||
@ -7,8 +7,8 @@
|
|||||||
// If you wish to distribute your changes, please submit them to the
|
// If you wish to distribute your changes, please submit them to the
|
||||||
// Colvars repository at GitHub.
|
// Colvars repository at GitHub.
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <cstdlib>
|
||||||
#include <string.h>
|
#include <cstring>
|
||||||
|
|
||||||
#include "colvarmodule.h"
|
#include "colvarmodule.h"
|
||||||
#include "colvartypes.h"
|
#include "colvartypes.h"
|
||||||
|
|||||||
@ -6,10 +6,10 @@
|
|||||||
|
|
||||||
EXTRAMAKE = Makefile.lammps.opencl
|
EXTRAMAKE = Makefile.lammps.opencl
|
||||||
|
|
||||||
OCL_TUNE = -DFERMI_OCL # -- Uncomment for NVIDIA Fermi
|
# OCL_TUNE = -DFERMI_OCL # -- Uncomment for NVIDIA Fermi
|
||||||
# OCL_TUNE = -DKEPLER_OCL # -- Uncomment for NVIDIA Kepler
|
# OCL_TUNE = -DKEPLER_OCL # -- Uncomment for NVIDIA Kepler
|
||||||
# OCL_TUNE = -DCYPRESS_OCL # -- Uncomment for AMD Cypress
|
# OCL_TUNE = -DCYPRESS_OCL # -- Uncomment for AMD Cypress
|
||||||
# OCL_TUNE = -DGENERIC_OCL # -- Uncomment for generic device
|
OCL_TUNE = -DGENERIC_OCL # -- Uncomment for generic device
|
||||||
|
|
||||||
# this setting should match LAMMPS Makefile
|
# this setting should match LAMMPS Makefile
|
||||||
# one of LAMMPS_SMALLBIG (default), LAMMPS_BIGBIG and LAMMPS_SMALLSMALL
|
# one of LAMMPS_SMALLBIG (default), LAMMPS_BIGBIG and LAMMPS_SMALLSMALL
|
||||||
|
|||||||
@ -300,7 +300,7 @@
|
|||||||
#ifndef __CUDPP_H__
|
#ifndef __CUDPP_H__
|
||||||
#define __CUDPP_H__
|
#define __CUDPP_H__
|
||||||
|
|
||||||
#include <stdlib.h> // for size_t
|
#include <cstdlib> // for size_t
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|||||||
@ -16,7 +16,7 @@
|
|||||||
//#include "cudpp_spmvmult.h"
|
//#include "cudpp_spmvmult.h"
|
||||||
#include "cudpp_radixsort.h"
|
#include "cudpp_radixsort.h"
|
||||||
|
|
||||||
#include <assert.h>
|
#include <cassert>
|
||||||
|
|
||||||
CUDPPPlanManager* CUDPPPlanManager::m_instance = NULL;
|
CUDPPPlanManager* CUDPPPlanManager::m_instance = NULL;
|
||||||
|
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
#include <cuda.h>
|
#include <cuda.h>
|
||||||
#include <cudpp.h>
|
#include <cudpp.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <float.h>
|
#include <cfloat>
|
||||||
|
|
||||||
#if (CUDA_VERSION >= 3000)
|
#if (CUDA_VERSION >= 3000)
|
||||||
#define LAUNCH_BOUNDS(x) __launch_bounds__((x))
|
#define LAUNCH_BOUNDS(x) __launch_bounds__((x))
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#ifndef NVD_MACROS_H
|
#ifndef NVD_MACROS_H
|
||||||
#define NVD_MACROS_H
|
#define NVD_MACROS_H
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <cstdio>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cuda.h>
|
#include <cuda.h>
|
||||||
|
|
||||||
|
|||||||
@ -353,7 +353,7 @@ int UCL_Device::set_platform(int pid) {
|
|||||||
_num_devices=0;
|
_num_devices=0;
|
||||||
return UCL_ERROR;
|
return UCL_ERROR;
|
||||||
}
|
}
|
||||||
cl_device_id device_list[_num_devices];
|
cl_device_id *device_list = new cl_device_id[_num_devices];
|
||||||
CL_SAFE_CALL(clGetDeviceIDs(_cl_platform,CL_DEVICE_TYPE_ALL,n,device_list,
|
CL_SAFE_CALL(clGetDeviceIDs(_cl_platform,CL_DEVICE_TYPE_ALL,n,device_list,
|
||||||
&n));
|
&n));
|
||||||
|
|
||||||
@ -362,7 +362,7 @@ int UCL_Device::set_platform(int pid) {
|
|||||||
_cl_devices.push_back(device_list[i]);
|
_cl_devices.push_back(device_list[i]);
|
||||||
add_properties(device_list[i]);
|
add_properties(device_list[i]);
|
||||||
}
|
}
|
||||||
|
delete[] device_list;
|
||||||
return UCL_SUCCESS;
|
return UCL_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -518,13 +518,14 @@ int UCL_Device::device_type(const int i) {
|
|||||||
int UCL_Device::set(int num) {
|
int UCL_Device::set(int num) {
|
||||||
clear();
|
clear();
|
||||||
|
|
||||||
cl_device_id device_list[_num_devices];
|
cl_device_id *device_list = new cl_device_id[_num_devices];
|
||||||
cl_uint n;
|
cl_uint n;
|
||||||
CL_SAFE_CALL(clGetDeviceIDs(_cl_platform,CL_DEVICE_TYPE_ALL,_num_devices,
|
CL_SAFE_CALL(clGetDeviceIDs(_cl_platform,CL_DEVICE_TYPE_ALL,_num_devices,
|
||||||
device_list,&n));
|
device_list,&n));
|
||||||
|
|
||||||
_device=num;
|
_device=num;
|
||||||
_cl_device=device_list[_device];
|
_cl_device=device_list[_device];
|
||||||
|
delete[] device_list;
|
||||||
return create_context();
|
return create_context();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -111,7 +111,7 @@ class UCL_Program {
|
|||||||
size_t ms;
|
size_t ms;
|
||||||
CL_SAFE_CALL(clGetProgramBuildInfo(_program,_device,CL_PROGRAM_BUILD_LOG,0,
|
CL_SAFE_CALL(clGetProgramBuildInfo(_program,_device,CL_PROGRAM_BUILD_LOG,0,
|
||||||
NULL, &ms));
|
NULL, &ms));
|
||||||
char build_log[ms];
|
char *build_log = new char[ms];
|
||||||
CL_SAFE_CALL(clGetProgramBuildInfo(_program,_device,CL_PROGRAM_BUILD_LOG,ms,
|
CL_SAFE_CALL(clGetProgramBuildInfo(_program,_device,CL_PROGRAM_BUILD_LOG,ms,
|
||||||
build_log, NULL));
|
build_log, NULL));
|
||||||
|
|
||||||
@ -127,8 +127,9 @@ class UCL_Program {
|
|||||||
<< "----------------------------------------------------------\n";
|
<< "----------------------------------------------------------\n";
|
||||||
std::cerr << build_log << std::endl;
|
std::cerr << build_log << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
delete[] build_log;
|
||||||
return UCL_COMPILE_ERROR;
|
return UCL_COMPILE_ERROR;
|
||||||
}
|
} else delete[] build_log;
|
||||||
}
|
}
|
||||||
|
|
||||||
return UCL_SUCCESS;
|
return UCL_SUCCESS;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#ifndef OCL_MACROS_H
|
#ifndef OCL_MACROS_H
|
||||||
#define OCL_MACROS_H
|
#define OCL_MACROS_H
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <cstdio>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
|
|||||||
@ -407,7 +407,7 @@ inline void _ocl_build(cl_program &program, cl_device_id &device,
|
|||||||
size_t ms;
|
size_t ms;
|
||||||
CL_SAFE_CALL(clGetProgramBuildInfo(program, device,CL_PROGRAM_BUILD_LOG, 0,
|
CL_SAFE_CALL(clGetProgramBuildInfo(program, device,CL_PROGRAM_BUILD_LOG, 0,
|
||||||
NULL, &ms));
|
NULL, &ms));
|
||||||
char build_log[ms];
|
char *build_log = new char[ms];
|
||||||
CL_SAFE_CALL(clGetProgramBuildInfo(program,device,CL_PROGRAM_BUILD_LOG,ms,
|
CL_SAFE_CALL(clGetProgramBuildInfo(program,device,CL_PROGRAM_BUILD_LOG,ms,
|
||||||
build_log, NULL));
|
build_log, NULL));
|
||||||
|
|
||||||
@ -416,6 +416,7 @@ inline void _ocl_build(cl_program &program, cl_device_id &device,
|
|||||||
<< " Error compiling OpenCL Program...\n"
|
<< " Error compiling OpenCL Program...\n"
|
||||||
<< "----------------------------------------------------------\n";
|
<< "----------------------------------------------------------\n";
|
||||||
std::cerr << build_log << std::endl;
|
std::cerr << build_log << std::endl;
|
||||||
|
delete[] build_log;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void _ocl_kernel_from_source(cl_context &context, cl_device_id &device,
|
inline void _ocl_kernel_from_source(cl_context &context, cl_device_id &device,
|
||||||
|
|||||||
@ -16,7 +16,7 @@
|
|||||||
#ifndef LAL_ANSWER_H
|
#ifndef LAL_ANSWER_H
|
||||||
#define LAL_ANSWER_H
|
#define LAL_ANSWER_H
|
||||||
|
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
#include "mpi.h"
|
#include "mpi.h"
|
||||||
|
|
||||||
#if defined(USE_OPENCL)
|
#if defined(USE_OPENCL)
|
||||||
|
|||||||
@ -16,7 +16,7 @@
|
|||||||
#ifndef PAIR_GPU_ATOM_H
|
#ifndef PAIR_GPU_ATOM_H
|
||||||
#define PAIR_GPU_ATOM_H
|
#define PAIR_GPU_ATOM_H
|
||||||
|
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
#include "mpi.h"
|
#include "mpi.h"
|
||||||
|
|
||||||
#if defined(USE_OPENCL)
|
#if defined(USE_OPENCL)
|
||||||
|
|||||||
@ -17,7 +17,7 @@
|
|||||||
#define LAL_BALANCE_H
|
#define LAL_BALANCE_H
|
||||||
|
|
||||||
#include "lal_device.h"
|
#include "lal_device.h"
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
|
|
||||||
#define _HD_BALANCE_EVERY 25
|
#define _HD_BALANCE_EVERY 25
|
||||||
#define _HD_BALANCE_WEIGHT 0.5
|
#define _HD_BALANCE_WEIGHT 0.5
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
|
|
||||||
#include "lal_beck.h"
|
#include "lal_beck.h"
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
|
|
||||||
#include "lal_born_coul_long.h"
|
#include "lal_born_coul_long.h"
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
|
|
||||||
#include "lal_born_coul_wolf.h"
|
#include "lal_born_coul_wolf.h"
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
|
|
||||||
#include "lal_born.h"
|
#include "lal_born.h"
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
|
|
||||||
#include "lal_buck_coul.h"
|
#include "lal_buck_coul.h"
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
|
|
||||||
#include "lal_buck_coul_long.h"
|
#include "lal_buck_coul_long.h"
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
|
|
||||||
#include "lal_buck.h"
|
#include "lal_buck.h"
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
|
|
||||||
#include "lal_charmm_long.h"
|
#include "lal_charmm_long.h"
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
|
|
||||||
#include "lal_colloid.h"
|
#include "lal_colloid.h"
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
|
|
||||||
#include "lal_coul_debye.h"
|
#include "lal_coul_debye.h"
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
|
|
||||||
#include "lal_coul_dsf.h"
|
#include "lal_coul_dsf.h"
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
|
|
||||||
#include "lal_coul.h"
|
#include "lal_coul.h"
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
|
|
||||||
#include "lal_coul_long.h"
|
#include "lal_coul_long.h"
|
||||||
|
|
||||||
|
|||||||
@ -16,7 +16,7 @@
|
|||||||
#include "lal_device.h"
|
#include "lal_device.h"
|
||||||
#include "lal_precision.h"
|
#include "lal_precision.h"
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
#ifdef _OPENMP
|
#ifdef _OPENMP
|
||||||
#include <omp.h>
|
#include <omp.h>
|
||||||
#endif
|
#endif
|
||||||
@ -78,7 +78,7 @@ int DeviceT::init_device(MPI_Comm world, MPI_Comm replica, const int first_gpu,
|
|||||||
// Get the names of all nodes
|
// Get the names of all nodes
|
||||||
int name_length;
|
int name_length;
|
||||||
char node_name[MPI_MAX_PROCESSOR_NAME];
|
char node_name[MPI_MAX_PROCESSOR_NAME];
|
||||||
char node_names[MPI_MAX_PROCESSOR_NAME*_world_size];
|
char *node_names = new char[MPI_MAX_PROCESSOR_NAME*_world_size];
|
||||||
MPI_Get_processor_name(node_name,&name_length);
|
MPI_Get_processor_name(node_name,&name_length);
|
||||||
MPI_Allgather(&node_name,MPI_MAX_PROCESSOR_NAME,MPI_CHAR,&node_names,
|
MPI_Allgather(&node_name,MPI_MAX_PROCESSOR_NAME,MPI_CHAR,&node_names,
|
||||||
MPI_MAX_PROCESSOR_NAME,MPI_CHAR,_comm_world);
|
MPI_MAX_PROCESSOR_NAME,MPI_CHAR,_comm_world);
|
||||||
@ -104,6 +104,7 @@ int DeviceT::init_device(MPI_Comm world, MPI_Comm replica, const int first_gpu,
|
|||||||
split_id=split_num;
|
split_id=split_num;
|
||||||
split_num++;
|
split_num++;
|
||||||
}
|
}
|
||||||
|
delete[] node_names;
|
||||||
|
|
||||||
// Set up a per node communicator and find rank within
|
// Set up a per node communicator and find rank within
|
||||||
MPI_Comm node_comm;
|
MPI_Comm node_comm;
|
||||||
|
|||||||
@ -22,7 +22,7 @@
|
|||||||
#include "lal_pppm.h"
|
#include "lal_pppm.h"
|
||||||
#include "mpi.h"
|
#include "mpi.h"
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include "stdio.h"
|
#include <cstdio>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <queue>
|
#include <queue>
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
|
|
||||||
#include "lal_dipole_lj.h"
|
#include "lal_dipole_lj.h"
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
|
|
||||||
#include "lal_dipole_lj_sf.h"
|
#include "lal_dipole_lj_sf.h"
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
|
|
||||||
#include "lal_dpd.h"
|
#include "lal_dpd.h"
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
|
|
||||||
#include "lal_eam.h"
|
#include "lal_eam.h"
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
|
|
||||||
#include "lal_eam.h"
|
#include "lal_eam.h"
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
|
|
||||||
#include "lal_eam.h"
|
#include "lal_eam.h"
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
|
|
||||||
#include "lal_gauss.h"
|
#include "lal_gauss.h"
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
|
|
||||||
#include "lal_gayberne.h"
|
#include "lal_gayberne.h"
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
|
|
||||||
#include "lal_lj96.h"
|
#include "lal_lj96.h"
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
|
|
||||||
#include "lal_lj_class2_long.h"
|
#include "lal_lj_class2_long.h"
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
|
|
||||||
#include "lal_lj_coul_debye.h"
|
#include "lal_lj_coul_debye.h"
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
|
|
||||||
#include "lal_lj_coul.h"
|
#include "lal_lj_coul.h"
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
|
|
||||||
#include "lal_lj_coul_long.h"
|
#include "lal_lj_coul_long.h"
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
|
|
||||||
#include "lal_lj_coul_msm.h"
|
#include "lal_lj_coul_msm.h"
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
|
|
||||||
#include "lal_lj_cubic.h"
|
#include "lal_lj_cubic.h"
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
|
|
||||||
#include "lal_lj_dsf.h"
|
#include "lal_lj_dsf.h"
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
|
|
||||||
#include "lal_lj_expand.h"
|
#include "lal_lj_expand.h"
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
|
|
||||||
#include "lal_lj.h"
|
#include "lal_lj.h"
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
|
|
||||||
#include "lal_lj_gromacs.h"
|
#include "lal_lj_gromacs.h"
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
|
|
||||||
#include "lal_lj_sdk.h"
|
#include "lal_lj_sdk.h"
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
|
|
||||||
#include "lal_lj_sdk_long.h"
|
#include "lal_lj_sdk_long.h"
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
|
|
||||||
#include "lal_mie.h"
|
#include "lal_mie.h"
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
|
|
||||||
#include "lal_morse.h"
|
#include "lal_morse.h"
|
||||||
|
|
||||||
|
|||||||
@ -17,7 +17,7 @@
|
|||||||
#include "lal_precision.h"
|
#include "lal_precision.h"
|
||||||
#include "lal_neighbor.h"
|
#include "lal_neighbor.h"
|
||||||
#include "lal_device.h"
|
#include "lal_device.h"
|
||||||
#include "math.h"
|
#include <cmath>
|
||||||
using namespace LAMMPS_AL;
|
using namespace LAMMPS_AL;
|
||||||
|
|
||||||
int Neighbor::bytes_per_atom(const int max_nbors) const {
|
int Neighbor::bytes_per_atom(const int max_nbors) const {
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
|
|
||||||
#include "lal_pppm.h"
|
#include "lal_pppm.h"
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
|
|
||||||
#include "lal_re_squared.h"
|
#include "lal_re_squared.h"
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
|
|
||||||
#include "lal_soft.h"
|
#include "lal_soft.h"
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
|
|
||||||
#include "lal_sw.h"
|
#include "lal_sw.h"
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
|
|
||||||
#include "lal_table.h"
|
#include "lal_table.h"
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
|
|
||||||
#include "lal_tersoff.h"
|
#include "lal_tersoff.h"
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
|
|
||||||
#include "lal_tersoff_mod.h"
|
#include "lal_tersoff_mod.h"
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
|
|
||||||
#include "lal_tersoff_zbl.h"
|
#include "lal_tersoff_zbl.h"
|
||||||
|
|
||||||
|
|||||||
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
|
|
||||||
#include "lal_ufm.h"
|
#include "lal_ufm.h"
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
|
|
||||||
#include "lal_vashishta.h"
|
#include "lal_vashishta.h"
|
||||||
using namespace LAMMPS_AL;
|
using namespace LAMMPS_AL;
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
|
|
||||||
#include "lal_yukawa_colloid.h"
|
#include "lal_yukawa_colloid.h"
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
|
|
||||||
#include "lal_yukawa.h"
|
#include "lal_yukawa.h"
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
|
|
||||||
#include "lal_zbl.h"
|
#include "lal_zbl.h"
|
||||||
|
|
||||||
|
|||||||
@ -16,7 +16,7 @@
|
|||||||
*_________________________________________________________________________*/
|
*_________________________________________________________________________*/
|
||||||
|
|
||||||
#include "eulerparameters.h"
|
#include "eulerparameters.h"
|
||||||
#include "math.h"
|
#include <cmath>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
|||||||
@ -262,7 +262,7 @@ void FastLU(Matrix& A, Matrix& LU, int *indx){ // LU is the LU decomposition of
|
|||||||
for (j=0;j<n;j++){
|
for (j=0;j<n;j++){
|
||||||
temp=fabs(LU.rows[i][j]);
|
temp=fabs(LU.rows[i][j]);
|
||||||
if (temp > big) big=temp;
|
if (temp > big) big=temp;
|
||||||
}
|
}
|
||||||
vv[i]=1.0/big;
|
vv[i]=1.0/big;
|
||||||
}
|
}
|
||||||
for (j=0;j<n;j++){
|
for (j=0;j<n;j++){
|
||||||
@ -276,8 +276,8 @@ void FastLU(Matrix& A, Matrix& LU, int *indx){ // LU is the LU decomposition of
|
|||||||
sum=LU.rows[i][j];
|
sum=LU.rows[i][j];
|
||||||
for (k=0;k<j;k++)
|
for (k=0;k<j;k++)
|
||||||
sum -= LU.rows[i][k]*LU.rows[k][j];
|
sum -= LU.rows[i][k]*LU.rows[k][j];
|
||||||
LU.rows[i][j]=sum;
|
LU.rows[i][j]=sum;
|
||||||
if ((dum=vv[i]*fabs(sum)) >= big) {
|
if ((dum=vv[i]*fabs(sum)) >= big) {
|
||||||
big=dum;
|
big=dum;
|
||||||
imax=i;
|
imax=i;
|
||||||
}
|
}
|
||||||
@ -311,7 +311,7 @@ void FastLU(Mat3x3& A, Mat3x3& LU, int *indx){ // LU is the LU decomposition of
|
|||||||
for (j=0;j<3;j++){
|
for (j=0;j<3;j++){
|
||||||
temp=fabs(LU.BasicGet(i,j));
|
temp=fabs(LU.BasicGet(i,j));
|
||||||
if (temp > big) big=temp;
|
if (temp > big) big=temp;
|
||||||
}
|
}
|
||||||
vv[i]=1.0/big;
|
vv[i]=1.0/big;
|
||||||
}
|
}
|
||||||
for (j=0;j<3;j++){
|
for (j=0;j<3;j++){
|
||||||
@ -325,8 +325,8 @@ void FastLU(Mat3x3& A, Mat3x3& LU, int *indx){ // LU is the LU decomposition of
|
|||||||
sum=LU.BasicGet(i,j);
|
sum=LU.BasicGet(i,j);
|
||||||
for (k=0;k<j;k++)
|
for (k=0;k<j;k++)
|
||||||
sum -= LU.BasicGet(i,k)*LU.BasicGet(k,j);
|
sum -= LU.BasicGet(i,k)*LU.BasicGet(k,j);
|
||||||
LU.BasicSet(i,j,sum);
|
LU.BasicSet(i,j,sum);
|
||||||
if ((dum=vv[i]*fabs(sum)) >= big) {
|
if ((dum=vv[i]*fabs(sum)) >= big) {
|
||||||
big=dum;
|
big=dum;
|
||||||
imax=i;
|
imax=i;
|
||||||
}
|
}
|
||||||
@ -373,8 +373,8 @@ void FastLU(Mat4x4& A, Mat4x4& LU, int *indx){ // LU is the LU decomposition of
|
|||||||
sum=LU.BasicGet(i,j);
|
sum=LU.BasicGet(i,j);
|
||||||
for (k=0;k<j;k++)
|
for (k=0;k<j;k++)
|
||||||
sum -= LU.BasicGet(i,k)*LU.BasicGet(k,j);
|
sum -= LU.BasicGet(i,k)*LU.BasicGet(k,j);
|
||||||
LU.BasicSet(i,j,sum);
|
LU.BasicSet(i,j,sum);
|
||||||
if ((dum=vv[i]*fabs(sum)) >= big) {
|
if ((dum=vv[i]*fabs(sum)) >= big) {
|
||||||
big=dum;
|
big=dum;
|
||||||
imax=i;
|
imax=i;
|
||||||
}
|
}
|
||||||
@ -421,8 +421,8 @@ void FastLU(Mat6x6& A, Mat6x6& LU, int *indx){ // LU is the LU decomposition of
|
|||||||
sum=LU.BasicGet(i,j);
|
sum=LU.BasicGet(i,j);
|
||||||
for (k=0;k<j;k++)
|
for (k=0;k<j;k++)
|
||||||
sum -= LU.BasicGet(i,k)*LU.BasicGet(k,j);
|
sum -= LU.BasicGet(i,k)*LU.BasicGet(k,j);
|
||||||
LU.BasicSet(i,j,sum);
|
LU.BasicSet(i,j,sum);
|
||||||
if ((dum=vv[i]*fabs(sum)) >= big) {
|
if ((dum=vv[i]*fabs(sum)) >= big) {
|
||||||
big=dum;
|
big=dum;
|
||||||
imax=i;
|
imax=i;
|
||||||
}
|
}
|
||||||
@ -1030,4 +1030,3 @@ void FastAssignT(Mat4x4& A, Mat4x4& C){
|
|||||||
C.elements[2][3] = A.elements[3][2];
|
C.elements[2][3] = A.elements[3][2];
|
||||||
C.elements[3][2] = A.elements[2][3];
|
C.elements[3][2] = A.elements[2][3];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user