15#ifndef HAVE_GETHOSTNAME
21 char *my_host_name=
"node";
26 size_t my_host_size=
strnlen(my_host_name, size-1);
28 strncpy(hostname, my_host_name, my_host_size);
32 hostname[my_host_size]=
'\0';
46 char info[128], hostname[256];
53 sprintf (info,
"QDP m%d,n%d@%s info: ",
54 rank, size, hostname);
56 va_start (argp, format);
57 int status = vsprintf (buffer, format, argp);
60 fprintf (stdout,
"%s %s\n", info, buffer);
72 char info[128], hostname[256];
79 sprintf (info,
"QDP m%d,n%d@%s error: ", rank, size, hostname);
81 va_start (argp, format);
82 int status = vsprintf (buffer, format, argp);
85 fprintf (stderr,
"%s %s\n", info, buffer);
96 char info[128], hostname[256];
103 sprintf (info,
"QDP m%d,n%d@%s fatal error: ", rank, size, hostname);
105 va_start (argp, format);
106 vsprintf (buffer, format, argp);
109 fprintf (stderr,
"%s %s\n", info, buffer);
137 d[num++] = prev_node = ll[ipos++];
140 while (ipos < ll.
size())
142 int this_node = ll[ipos++];
144 if (this_node != prev_node)
148 for(
int i=0; i < num; ++i)
149 if (d[i] == this_node)
157 d[num++] = this_node;
160 prev_node = this_node;
165 for(
int i=0; i < num; ++i)
Container for a multi-dimensional 1D array.
int size() const
Size of array.
int nodeNumber()
Returns the node number of this node.
int numNodes()
Returns the number of nodes.
Yet another random number generator.
void QDP_error_exit(const char *format,...)
Simple error display and abort routine.
int QDP_error(const char *format,...)
Simple error display routine.
void QDP_verbose(bool verbose)
multi1d< int > uniquify_list(const multi1d< int > &ll)
Unique-ify a list.
void QDP_abort(int status)
Panic button.
int QDP_info(const char *format,...)
Simple information display routine.
Primary include file for QDP.
int gethostname(char *, size_t)
size_t strnlen(const char *s, size_t maxlen)
int gethostname(char *hostname, size_t size)