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" 57 int send_dgram(
const char *host_addr,
int port,
const char *buf,
int buflen) {
58 struct sockaddr_in addr;
62 if ((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
66 memset(&addr, 0,
sizeof(addr));
67 addr.sin_family = AF_INET;
68 addr.sin_port = htons(port);
69 addr.sin_addr.s_addr = inet_addr(host_addr);
71 sendto(sockfd, buf, buflen, 0, (
struct sockaddr *)&addr,
sizeof(addr));
81 const char *versionnum,
84 const char *miscinfo) {
87 #ifdef TBSOFT_TRACK_HOST 89 <<
"Sending usage information to " << TBSOFT_TRACK_HOST
90 <<
":" << TBSOFT_TRACK_PORT <<
" via UDP. Sent data is:\n";
98 memset(sendbuf, 0,
sizeof(sendbuf));
100 gethostname(host, 128); host[127] = 0;
101 pw = getpwuid(getuid());
102 if ( pw && pw->pw_name ) {
103 strncpy(user, pw->pw_name, 127); user[127] = 0;
105 sprintf(user,
"%d",getuid());
108 sprintf(sendbuf,
"1 %s %s %s %s %s %s %s",
109 program, versionnum, platform, numcpus, miscinfo, host, user);
111 #ifdef TBSOFT_TRACK_HOST 112 send_dgram(TBSOFT_TRACK_HOST, TBSOFT_TRACK_PORT, sendbuf, strlen(sendbuf));
132 iout <<
iINFO <<
"NAMD " << NAMD_VERSION <<
" for " << NAMD_PLATFORM
134 #ifdef MEM_OPT_VERSION 136 <<
iWARN <<
" *** EXPERIMENTAL MEMORY OPTIMIZED VERSION ***\n" 141 <<
iWARN <<
" *** UNRELEASED EXPERIMENTAL VERSION ***\n" 144 #ifdef SPEC_DISABLED_VERSION 147 <<
iINFO <<
"NAMD is a parallel, object-oriented molecular dynamics\n" 148 <<
iINFO <<
"code designed for high-performance simulation of large\n" 149 <<
iINFO <<
"biomolecular systems. NAMD is distributed free of\n" 150 <<
iINFO <<
"charge and includes source code. For more information\n" 151 <<
iINFO <<
"please visit http://www.ks.uiuc.edu/Research/namd/\n" 153 <<
iINFO <<
"*********************************************************\n" 154 <<
iINFO <<
"This version of NAMD may be distributed only as a part of\n" 155 <<
iINFO <<
"the SPEC Workstation Benchmark and all other distribution\n" 156 <<
iINFO <<
"is prohibited. Any use of this software is bound by\n" 157 <<
iINFO <<
"the terms of the NAMD License, which is available at\n" 158 <<
iINFO <<
"http://www.ks.uiuc.edu/Research/namd/license.html\n" 159 <<
iINFO <<
"The NAMD development team will not provide support for\n" 160 <<
iINFO <<
"any version of NAMD unless you have first registered\n" 161 <<
iINFO <<
"and downloaded the latest version of NAMD available at\n" 162 <<
iINFO <<
"http://www.ks.uiuc.edu/Research/namd/\n" 163 <<
iINFO <<
"*********************************************************\n" 166 <<
iINFO <<
"Please visit http://www.ks.uiuc.edu/Research/namd/\n" 167 <<
iINFO <<
"for updates, documentation, and support information.\n" 170 <<
iINFO <<
"Please cite Phillips et al., J. Chem. Phys. 153:044130 (2020) " 171 "doi:10.1063/5.0014475\n" 172 <<
iINFO <<
"in all publications reporting results obtained with NAMD.\n" 176 char charm_version[64];
177 sprintf(charm_version,
"%d",CHARM_VERSION);
179 #if CHARM_VERSION < 60500 180 #error "Charm++ 6.5.1 or later is required to build NAMD" 183 iout <<
iINFO <<
"Based on Charm++/Converse " << charm_version
184 <<
" for " << CMK_MACHINE_NAME <<
"\n" <<
endi;
191 sprintf(numcpus,
"%d",CkNumPes());
195 #if CMK_BLUEGENE_CHARM 196 iout <<
iINFO <<
"Running on BigSim using " << CmiNumPes() <<
" real processors.\n" <<
endi;
198 iout <<
iINFO <<
"Running on " << CkNumPes() <<
" processors, " 199 << CmiNumNodes() <<
" nodes, " 200 << CmiNumPhysicalNodes() <<
" physical nodes.\n" <<
endi;
201 iout <<
iINFO <<
"CPU topology information " << (CmiCpuTopologyEnabled()?
"available":
"unavailable") <<
".\n" <<
endi;
202 iout <<
iINFO <<
"Charm++/Converse parallel runtime startup completed at " 203 << CmiWallTimer() <<
" s\n"<<
endi;
204 const char* memsource;
207 <<
" based on " << memsource <<
"\n";
210 if ( CmiNumNodes() > 1 && CkNumPes() == CmiNumNodes() ) {
211 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.");
219 #ifndef USE_NO_BITFIELDS 220 iout <<
iINFO <<
"Using bitfields in atom data structures.\n" <<
endi;
222 iout <<
iINFO <<
"Using NO bitfields in atom data structures.\n" <<
endi;
233 #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)
char const *const NamdProfileEventStr[]
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)
void RegisterNamdEventsProfiling()
unsigned long memusage(const char **source)
int send_dgram(const char *host_addr, int port, const char *buf, int buflen)
#define NAMD_REGISTER_EVENT(name, cid)