16 #include <sys/types.h>
20 #if defined(__TURBOC__)
28 #include <iostream.hpp>
29 #define S_IREAD 0000400
30 #define S_IWRITE 0000200
39 int LSEEK(
int,
int,
int);
40 int open(
const char*,
int);
41 int creat(
const char*,
int);
43 int write(
int,
char*,
int);
44 int read(
int,
char*,
int);
52 #include <sys/types.h>
65 #if defined(__ADSGI__)
74 void byte_copy(
void* dest,
void* source,
const size_t num_bytes)
76 char* pdest = (
char*)dest;
77 char* psource = (
char*)source;
79 while (ii < num_bytes)
99 #if defined(_MSC_VER) || defined(__MINGW64__)
101 #elif defined(__OPENCC__)
104 #elif defined(__x86_64)
111 cout <<
"Error -- largest size for CMPDIF_BUFFER_SIZE is " << max <<
endl;
116 #if defined(_MSC_VER) || defined(__MINGW64__)
117 buff_size =
static_cast<unsigned int>(
static_cast<size_t>(nbytes) +
sizeof(
OFF_T));
127 catch (
const std::bad_alloc& e)
129 size_t gb = nbytes / 1073741824;
130 cerr <<
"Error: Unable to construct DF_FILE memory buffer\n"
131 <<
"of size " << nbytes <<
" bytes or " << gb <<
"GB.\n";
142 char* path = getenv(
"ADTMP1");
144 #if defined(USE_ADPVM)
146 if (path) string_path=path;
161 path=(
char*) string_path;
165 cerr <<
"Wrong number of options to -slave -- must be 1"
166 " you have " << nopt <<
endl;
173 if (path != NULL && strlen(path) <= 45)
174 #if !defined (_WIN32)
208 #if defined (_MSC_VER) || defined (__WAT32__)
211 #elif defined (__TURBOC__)
214 #elif defined (__ZTC__)
217 #elif defined (__NDPX__)
225 ad_printf(
"Error opening temporary gradient"
244 <<
" = " << pos <<
endl;
250 #if !defined (_WIN32)
272 if (
toffset < static_cast<OFF_T>(num_bytes))
283 #if defined(__ADSGI__)
307 if (static_cast<OFF_T>(num_bytes) >
buff_end)
310 cerr <<
"Need to increase gradient_structure::CMPDIF_BUFFER_SIZE "
311 "to at least" << us <<
endl;
317 #if defined(__ADSGI__)
332 cerr <<
"Error rewinding file in DF_FILE:fread"<<
endl;
341 for (
size_t i = 0;i <
sizeof(
OFF_T); i++)
353 for (
size_t i = 0; i <
sizeof(
OFF_T); i++)
360 cerr <<
"There is probably no more room on the TMP1 (if defined) device\n"
361 "If possible set TMP1 environment string to a device with more room\n";
void read(const test_smartlist &, void *, int nsize)
static adpvm_manager * pvm_manager
void memcpy(test_smartlist &dest, void *source, const size_t nsize)
memcpy for test_smartlist
static ofstream * global_logfile
DF_FILE()
Default uses gradient_structure::CMPDIF_BUFFER_SIZE.
static int no_derivatives
char cmpdif_file_name[81]
char lastchar(char *)
Description not yet available.
void write_cmpdif_stack_buffer()
Description not yet available.
void read_cmpdif_stack_buffer(OFF_T &lpos)
Description not yet available.
prnstream & endl(prnstream &)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
char fourb[sizeof(OFF_T)]
void ad_getcd(const adstring &s)
Description not yet available.
static void xxx(ivector re_list, ivector fe_list)
int option_match(int argc, char *argv[], const char *string)
Checks if the program has been invoked with a particular command line argument ("string").
void write(const test_smartlist &, void *, int nsize)
size_t pos(const adstring &substr, const adstring &s)
void fwrite(const void *s, const size_t num_bytes)
Reads num_bytes from s and writes to buffer.
void fread(void *s, const size_t num_bytes)
Reads num_bytes from buffer and copies to s.
int make_sub_directory(const char *s)
Create a sub directory s.
int ad_printf(FILE *stream, const char *format, Args...args)