本文整理汇总了C++中VMDApp::par_rank方法的典型用法代码示例。如果您正苦于以下问题:C++ VMDApp::par_rank方法的具体用法?C++ VMDApp::par_rank怎么用?C++ VMDApp::par_rank使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VMDApp
的用法示例。
在下文中一共展示了VMDApp::par_rank方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: vmdinfo_tcl
static int vmdinfo_tcl(ClientData, Tcl_Interp *interp,
int argc, const char *argv[]) {
VMDApp *app = (VMDApp *)Tcl_GetAssocData(interp, "VMDApp", NULL);
if (argc == 2) {
SIMPLE_TCL_OPT("version", VMDVERSION);
SIMPLE_TCL_OPT("versionmsg", VERSION_MSG);
SIMPLE_TCL_OPT("authors", VMD_AUTHORS);
SIMPLE_TCL_OPT("arch", VMD_ARCH);
SIMPLE_TCL_OPT("options", VMD_OPTIONS);
SIMPLE_TCL_OPT("www", VMD_HOMEPAGE);
SIMPLE_TCL_OPT("wwwhelp", VMD_HELPPAGE);
// return the estimated amount of available physical memory
if (!strcmp(argv[1], "freemem")) {
long vmdcorefree = vmd_get_avail_physmem_mb();
Tcl_Obj *tcl_result = Tcl_NewListObj(0, NULL);
Tcl_ListObjAppendElement(interp, tcl_result, Tcl_NewIntObj(vmdcorefree));
Tcl_SetObjResult(interp, tcl_result);
return TCL_OK;
}
// return the number of available CPU cores
if (!strcmp(argv[1], "numcpus")) {
#if defined(VMDTHREADS)
int numcpus = wkf_thread_numprocessors();
#else
int numcpus = 1;
#endif
Tcl_Obj *tcl_result = Tcl_NewListObj(0, NULL);
Tcl_ListObjAppendElement(interp, tcl_result, Tcl_NewIntObj(numcpus));
Tcl_SetObjResult(interp, tcl_result);
return TCL_OK;
}
// return the CPU affinity list for the VMD process
if (!strcmp(argv[1], "cpuaffinity")) {
int numcpus = -1;
int *cpuaffinitylist = NULL;
#if defined(VMDTHREADS)
cpuaffinitylist = wkf_cpu_affinitylist(&numcpus);
#endif
if (numcpus > 0 && cpuaffinitylist != NULL) {
int i;
Tcl_Obj *tcl_result = Tcl_NewListObj(0, NULL);
for (i=0; i<numcpus; i++)
Tcl_ListObjAppendElement(interp, tcl_result, Tcl_NewIntObj(cpuaffinitylist[i]));
Tcl_SetObjResult(interp, tcl_result);
return TCL_OK;
}
if (cpuaffinitylist != NULL)
free(cpuaffinitylist);
Tcl_AppendResult(interp, "CPU affinity query unavailable on this platform", NULL);
return TCL_ERROR;
}
// return the number of available CUDA devices
if (!strcmp(argv[1], "numcudadevices")) {
int numdevices;
#if defined(VMDCUDA)
vmd_cuda_num_devices(&numdevices);
#else
numdevices = 0;
#endif
Tcl_Obj *tcl_result = Tcl_NewListObj(0, NULL);
Tcl_ListObjAppendElement(interp, tcl_result, Tcl_NewIntObj(numdevices));
Tcl_SetObjResult(interp, tcl_result);
return TCL_OK;
}
// return the active display device (e.g. "text", "win", "cave", ...)
if (!strcmp(argv[1], "dispdev")) {
const char *disp = VMDgetDisplayTypeName();
Tcl_AppendResult(interp, disp, NULL);
return TCL_OK;
}
// return the MPI node name
if (!strcmp(argv[1], "nodename")) {
Tcl_Obj *tcl_result = Tcl_NewListObj(0, NULL);
Tcl_ListObjAppendElement(interp, tcl_result, Tcl_NewStringObj(app->par_name(), strlen(app->par_name())));
Tcl_SetObjResult(interp, tcl_result);
return TCL_OK;
}
// return the MPI node rank
if (!strcmp(argv[1], "noderank")) {
Tcl_Obj *tcl_result = Tcl_NewListObj(0, NULL);
Tcl_ListObjAppendElement(interp, tcl_result, Tcl_NewIntObj(app->par_rank()));
Tcl_SetObjResult(interp, tcl_result);
return TCL_OK;
}
//.........这里部分代码省略.........