MAINT: bigint (int64) maps onto either long or long long, depending on platform. Automatically choose the correct one.
This commit is contained in:
@ -607,6 +607,32 @@ void DumpNetCDF::closefile()
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
int nc_put_var1_x(int ncid, int varid, const size_t index[], const T* tp)
|
||||||
|
{
|
||||||
|
return nc_put_var1_double(ncid, varid, index, tp);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <>
|
||||||
|
int nc_put_var1_x<int>(int ncid, int varid, const size_t index[], const int* tp)
|
||||||
|
{
|
||||||
|
return nc_put_var1_int(ncid, varid, index, tp);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <>
|
||||||
|
int nc_put_var1_x<long>(int ncid, int varid, const size_t index[],
|
||||||
|
const long* tp)
|
||||||
|
{
|
||||||
|
return nc_put_var1_long(ncid, varid, index, tp);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <>
|
||||||
|
int nc_put_var1_x<long long>(int ncid, int varid, const size_t index[],
|
||||||
|
const long long* tp)
|
||||||
|
{
|
||||||
|
return nc_put_var1_longlong(ncid, varid, index, tp);
|
||||||
|
}
|
||||||
|
|
||||||
void DumpNetCDF::write()
|
void DumpNetCDF::write()
|
||||||
{
|
{
|
||||||
// open file
|
// open file
|
||||||
@ -638,13 +664,8 @@ void DumpNetCDF::write()
|
|||||||
th->keyword[i] );
|
th->keyword[i] );
|
||||||
}
|
}
|
||||||
else if (th->vtype[i] == BIGINT) {
|
else if (th->vtype[i] == BIGINT) {
|
||||||
#if defined(LAMMPS_SMALLBIG) || defined(LAMMPS_BIGBIG)
|
NCERRX( nc_put_var1_x(ncid, thermovar[i], start, &th->bivalue),
|
||||||
NCERRX( nc_put_var1_long(ncid, thermovar[i], start, &th->bivalue),
|
|
||||||
th->keyword[i] );
|
th->keyword[i] );
|
||||||
#else
|
|
||||||
NCERRX( nc_put_var1_int(ncid, thermovar[i], start, &th->bivalue),
|
|
||||||
th->keyword[i] );
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -930,11 +951,7 @@ void DumpNetCDF::write_prmtop()
|
|||||||
|
|
||||||
fprintf(f, "%%FLAG POINTERS\n");
|
fprintf(f, "%%FLAG POINTERS\n");
|
||||||
fprintf(f, "%%FORMAT(10I8)\n");
|
fprintf(f, "%%FORMAT(10I8)\n");
|
||||||
#if defined(LAMMPS_SMALLBIG) || defined(LAMMPS_BIGBIG)
|
fprintf(f, BIGINT_FORMAT, ntotalgr);
|
||||||
fprintf(f, "%8li", ntotalgr);
|
|
||||||
#else
|
|
||||||
fprintf(f, "%8i", ntotalgr);
|
|
||||||
#endif
|
|
||||||
for (int i = 0; i < 11; i++)
|
for (int i = 0; i < 11; i++)
|
||||||
fprintf(f, "%8i", 0);
|
fprintf(f, "%8i", 0);
|
||||||
fprintf(f, "\n");
|
fprintf(f, "\n");
|
||||||
|
|||||||
@ -583,6 +583,34 @@ void DumpNetCDFMPIIO::closefile()
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
int ncmpi_put_var1_x(int ncid, int varid, const MPI_Offset index[],
|
||||||
|
const T* tp)
|
||||||
|
{
|
||||||
|
return ncmpi_put_var1_double(ncid, varid, index, tp);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <>
|
||||||
|
int ncmpi_put_var1_x<int>(int ncid, int varid, const MPI_Offset index[],
|
||||||
|
const int* tp)
|
||||||
|
{
|
||||||
|
return ncmpi_put_var1_int(ncid, varid, index, tp);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <>
|
||||||
|
int ncmpi_put_var1_x<long>(int ncid, int varid, const MPI_Offset index[],
|
||||||
|
const long* tp)
|
||||||
|
{
|
||||||
|
return ncmpi_put_var1_long(ncid, varid, index, tp);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <>
|
||||||
|
int ncmpi_put_var1_x<long long>(int ncid, int varid, const MPI_Offset index[],
|
||||||
|
const long long* tp)
|
||||||
|
{
|
||||||
|
return ncmpi_put_var1_longlong(ncid, varid, index, tp);
|
||||||
|
}
|
||||||
|
|
||||||
void DumpNetCDFMPIIO::write()
|
void DumpNetCDFMPIIO::write()
|
||||||
{
|
{
|
||||||
// open file
|
// open file
|
||||||
@ -616,13 +644,8 @@ void DumpNetCDFMPIIO::write()
|
|||||||
th->keyword[i] );
|
th->keyword[i] );
|
||||||
}
|
}
|
||||||
else if (th->vtype[i] == BIGINT) {
|
else if (th->vtype[i] == BIGINT) {
|
||||||
#if defined(LAMMPS_SMALLBIG) || defined(LAMMPS_BIGBIG)
|
NCERRX( ncmpi_put_var1_x(ncid, thermovar[i], start, &th->bivalue),
|
||||||
NCERRX( ncmpi_put_var1_long(ncid, thermovar[i], start, &th->bivalue),
|
|
||||||
th->keyword[i] );
|
th->keyword[i] );
|
||||||
#else
|
|
||||||
NCERRX( ncmpi_put_var1_int(ncid, thermovar[i], start, &th->bivalue),
|
|
||||||
th->keyword[i] );
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user