本文整理汇总了C++中VMDApp::par_size方法的典型用法代码示例。如果您正苦于以下问题:C++ VMDApp::par_size方法的具体用法?C++ VMDApp::par_size怎么用?C++ VMDApp::par_size使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VMDApp
的用法示例。
在下文中一共展示了VMDApp::par_size方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: vmdinfo_tcl
//.........这里部分代码省略.........
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;
}
// return the MPI node count
if (!strcmp(argv[1], "nodecount")) {
Tcl_Obj *tcl_result = Tcl_NewListObj(0, NULL);
Tcl_ListObjAppendElement(interp, tcl_result, Tcl_NewIntObj(app->par_size()));
Tcl_SetObjResult(interp, tcl_result);
return TCL_OK;
}
}
Tcl_AppendResult(interp,
"vmdinfo: version | versionmsg | authors | arch | \n"
"freemem | numcpus | cpuaffinity | numcudadevices | \n"
"dispdev | nodename | noderank | nodecount | \n"
"options | www | wwwhelp", NULL);
return TCL_ERROR;
}