21 #ifndef TBSOFT_TRACK_MAXLEN
22 #define TBSOFT_TRACK_MAXLEN 1024
28 #include <sys/types.h>
30 #include <arpa/inet.h>
32 #include <sys/socket.h>
33 #include <netinet/in.h>
43 #include "main.decl.h"
48 int send_dgram(
const char *host_addr,
int port,
const char *buf,
int buflen) {
49 struct sockaddr_in addr;
53 if ((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
57 memset(&addr, 0,
sizeof(addr));
58 addr.sin_family = AF_INET;
59 addr.sin_port = htons(port);
60 addr.sin_addr.s_addr = inet_addr(host_addr);
62 sendto(sockfd, buf, buflen, 0, (
struct sockaddr *)&addr,
sizeof(addr));
72 const char *versionnum,
75 const char *miscinfo) {
78 #ifdef TBSOFT_TRACK_HOST
80 <<
"Sending usage information to " << TBSOFT_TRACK_HOST
81 <<
":" << TBSOFT_TRACK_PORT <<
" via UDP. Sent data is:\n";
89 memset(sendbuf, 0,
sizeof(sendbuf));
91 gethostname(host, 128); host[127] = 0;
92 pw = getpwuid(getuid());
93 if ( pw && pw->pw_name ) {
94 strncpy(user, pw->pw_name, 127); user[127] = 0;
96 sprintf(user,
"%d",getuid());
99 sprintf(sendbuf,
"1 %s %s %s %s %s %s %s",
100 program, versionnum, platform, numcpus, miscinfo, host, user);
102 #ifdef TBSOFT_TRACK_HOST
103 send_dgram(TBSOFT_TRACK_HOST, TBSOFT_TRACK_PORT, sendbuf, strlen(sendbuf));
123 iout <<
iINFO <<
"NAMD " << NAMD_VERSION <<
" for " << NAMD_PLATFORM
125 #ifdef MEM_OPT_VERSION
127 <<
iWARN <<
" *** EXPERIMENTAL MEMORY OPTIMIZED VERSION ***\n"
132 <<
iWARN <<
" *** UNRELEASED EXPERIMENTAL VERSION ***\n"
135 #ifdef SPEC_DISABLED_VERSION
138 <<
iINFO <<
"NAMD is a parallel, object-oriented molecular dynamics\n"
139 <<
iINFO <<
"code designed for high-performance simulation of large\n"
140 <<
iINFO <<
"biomolecular systems. NAMD is distributed free of\n"
141 <<
iINFO <<
"charge and includes source code. For more information\n"
142 <<
iINFO <<
"please visit http://www.ks.uiuc.edu/Research/namd/\n"
144 <<
iINFO <<
"*********************************************************\n"
145 <<
iINFO <<
"This version of NAMD may be distributed only as a part of\n"
146 <<
iINFO <<
"the SPEC Workstation Benchmark and all other distribution\n"
147 <<
iINFO <<
"is prohibited. Any use of this software is bound by\n"
148 <<
iINFO <<
"the terms of the NAMD License, which is available at\n"
149 <<
iINFO <<
"http://www.ks.uiuc.edu/Research/namd/license.html\n"
150 <<
iINFO <<
"The NAMD development team will not provide support for\n"
151 <<
iINFO <<
"any version of NAMD unless you have first registered\n"
152 <<
iINFO <<
"and downloaded the latest version of NAMD available at\n"
153 <<
iINFO <<
"http://www.ks.uiuc.edu/Research/namd/\n"
154 <<
iINFO <<
"*********************************************************\n"
157 <<
iINFO <<
"Please visit http://www.ks.uiuc.edu/Research/namd/\n"
158 <<
iINFO <<
"for updates, documentation, and support information.\n"
161 <<
iINFO <<
"Please cite Phillips et al., J. Chem. Phys. 153:044130 (2020) "
162 "doi:10.1063/5.0014475\n"
163 <<
iINFO <<
"in all publications reporting results obtained with NAMD.\n"
167 char charm_version[64];
168 sprintf(charm_version,
"%d",CHARM_VERSION);
170 #if CHARM_VERSION < 60500
171 #error "Charm++ 6.5.1 or later is required to build NAMD"
174 iout <<
iINFO <<
"Based on Charm++/Converse " << charm_version
175 <<
" for " << CMK_MACHINE_NAME <<
"\n" <<
endi;
182 sprintf(numcpus,
"%d",CkNumPes());
186 #if CMK_BLUEGENE_CHARM
187 iout <<
iINFO <<
"Running on BigSim using " << CmiNumPes() <<
" real processors.\n" <<
endi;
189 iout <<
iINFO <<
"Running on " << CkNumPes() <<
" processors, "
190 << CmiNumNodes() <<
" nodes, "
191 << CmiNumPhysicalNodes() <<
" physical nodes.\n" <<
endi;
192 iout <<
iINFO <<
"CPU topology information " << (CmiCpuTopologyEnabled()?
"available":
"unavailable") <<
".\n" << endi;
193 iout <<
iINFO <<
"Charm++/Converse parallel runtime startup completed at "
194 << CmiWallTimer() <<
" s\n"<<
endi;
195 const char* memsource;
198 <<
" based on " << memsource <<
"\n";
201 if ( CmiNumNodes() > 1 && CkNumPes() == CmiNumNodes() ) {
202 NAMD_die(
"SMP build launched as multiple single-thread processes. Use ++ppn to set number of worker threads per process to match available cores, reserving one core per process for communication thread.");
208 #include "main.def.h"
std::ostream & iINFO(std::ostream &s)
const char * namd_build_date
int tbsoft_sendusage(const char *program, const char *versionnum, const char *platform, const char *numcpus, const char *miscinfo)
std::ostream & endi(std::ostream &s)
const char * namd_build_machine
std::ostream & iWARN(std::ostream &s)
#define TBSOFT_TRACK_MAXLEN
const char * namd_build_user
void NAMD_die(const char *err_msg)
unsigned long memusage(const char **source)
int send_dgram(const char *host_addr, int port, const char *buf, int buflen)