forked from lijiext/lammps
git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@5519 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
parent
55990d87cb
commit
4bc2d6f332
|
@ -28,12 +28,16 @@
|
|||
|
||||
// MPI_LMP_TAGINT = MPI data type corresponding to tagint
|
||||
// MPI_LMP_BIGINT = MPI data type corresponding to bigint
|
||||
// NOTE: you may need to set MPI_LMP_BIGINT to MPI_LONG
|
||||
// if your machine/MPI does not support "long long" data types
|
||||
|
||||
// NOTE:
|
||||
// if your machine/MPI does not support "long long" data types,
|
||||
// but only "long" data types, then you will need to set
|
||||
// MPI_LMP_BIGINT to MPI_LONG, LLONG_MAX to LONG_MAX, and "lld" to "ld"
|
||||
|
||||
#ifndef LMP_LMPTYPE_H
|
||||
#define LMP_LMPTYPE_H
|
||||
|
||||
#include "limits.h"
|
||||
#include "stdint.h"
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
|
@ -45,17 +49,17 @@ typedef int smallint;
|
|||
typedef int tagint;
|
||||
typedef int64_t bigint;
|
||||
|
||||
#define MAXSMALLINT 0x7FFFFFFF
|
||||
#define MAXTAGINT 0x7FFFFFFF
|
||||
#define MAXBIGINT 0x7FFFFFFFFFFFFFFFLL
|
||||
#define MAXSMALLINT INT_MAX
|
||||
#define MAXTAGINT INT_MAX
|
||||
#define MAXBIGINT LLONG_MAX
|
||||
|
||||
#define MPI_LMP_TAGINT MPI_INT
|
||||
#define MPI_LMP_BIGINT MPI_LONG_LONG
|
||||
|
||||
#define TAGINT_FORMAT "%d"
|
||||
#define BIGINT_FORMAT "%ld"
|
||||
#define BIGINT_FORMAT "%lld"
|
||||
#define TAGINT_FORMAT_NL "%d\n"
|
||||
#define BIGINT_FORMAT_NL "%ld\n"
|
||||
#define BIGINT_FORMAT_NL "%lld\n"
|
||||
|
||||
// for molecular problems that exceed 2 billion (2^31) atoms
|
||||
// 32-bit smallint, 64-bit tagint and bigint
|
||||
|
@ -66,20 +70,20 @@ typedef int smallint;
|
|||
typedef int64_t tagint;
|
||||
typedef int64_t bigint;
|
||||
|
||||
#define MAXSMALLINT 0x7FFFFFFF
|
||||
#define MAXTAGINT 0x7FFFFFFFFFFFFFFFLL
|
||||
#define MAXBIGINT 0x7FFFFFFFFFFFFFFFLL
|
||||
#define MAXSMALLINT INT_MAX
|
||||
#define MAXTAGINT LLONG_MAX
|
||||
#define MAXBIGINT LLONG_MAX
|
||||
|
||||
#define MPI_LMP_TAGINT MPI_LONG_LONG
|
||||
#define MPI_LMP_BIGINT MPI_LONG_LONG
|
||||
|
||||
#define TAGINT_FORMAT "%ld"
|
||||
#define BIGINT_FORMAT "%ld"
|
||||
#define TAGINT_FORMAT_NL "%ld\n"
|
||||
#define BIGINT_FORMAT_NL "%ld\n"
|
||||
#define TAGINT_FORMAT "%lld"
|
||||
#define BIGINT_FORMAT "%lld"
|
||||
#define TAGINT_FORMAT_NL "%lld\n"
|
||||
#define BIGINT_FORMAT_NL "%lld\n"
|
||||
*/
|
||||
|
||||
// for machines that don't support 64-bit ints
|
||||
// for machines that do not support 64-bit ints
|
||||
// 32-bit smallint and tagint and bigint
|
||||
|
||||
/*
|
||||
|
@ -87,9 +91,9 @@ typedef int smallint;
|
|||
typedef int tagint;
|
||||
typedef int bigint;
|
||||
|
||||
#define MAXSMALLINT 0x7FFFFFFF
|
||||
#define MAXTAGINT 0x7FFFFFFF
|
||||
#define MAXBIGINT 0x7FFFFFFF
|
||||
#define MAXSMALLINT INT_MAX
|
||||
#define MAXTAGINT INT_MAX
|
||||
#define MAXBIGINT INT_MAX
|
||||
|
||||
#define MPI_LMP_TAGINT MPI_INT
|
||||
#define MPI_LMP_BIGINT MPI_INT
|
||||
|
|
|
@ -509,16 +509,14 @@ void Thermo::modify_params(int narg, char **arg)
|
|||
format_int_user = new char[n];
|
||||
strcpy(format_int_user,arg[iarg+2]);
|
||||
if (format_bigint_user) delete [] format_bigint_user;
|
||||
n = strlen(format_int_user) + 2;
|
||||
n = strlen(format_int_user) + 3;
|
||||
format_bigint_user = new char[n];
|
||||
char *ptr = strchr(format_int_user,'d');
|
||||
if (ptr == NULL)
|
||||
error->all("Thermo_modify int format does not contain d character");
|
||||
*ptr = '\0';
|
||||
if (sizeof(bigint) == 8)
|
||||
sprintf(format_bigint_user,"%s%s%s",format_int_user,"ld",ptr+1);
|
||||
else if (sizeof(bigint) == 4)
|
||||
sprintf(format_bigint_user,"%s%s%s",format_int_user,"d",ptr+1);
|
||||
sprintf(format_bigint_user,"%s%s%s",format_int_user,
|
||||
BIGINT_FORMAT,ptr+1);
|
||||
*ptr = 'd';
|
||||
} else if (strcmp(arg[iarg+1],"float") == 0) {
|
||||
if (format_float_user) delete [] format_float_user;
|
||||
|
|
Loading…
Reference in New Issue