1. <target>
comsol                        : 启动COMSOL
comsol server                  : 启动COMSOL SERVER,用于联用MATLAB
comsol client                  : 启动COMSOL CLIENT
comsol batch                  : 命令行模式的COMSOL,用于运行一个MPH算例或class文件
comsol compile                : 编译模型java文件,用于JAVA API
comsol server matlab          : 启动MATLAB并连接到COMSOL SERVER,SSH下个人推荐这种方式,原因自己体会
comsol matlab                  : 启动MATLAB,并设置COMSOL的路径,不灵的(它没把mli下级目录添加进去,因此需要手动设置下)
comsol convertpre35a          : 转换COMSOL v3.x版本模型,我觉得是生成高版本的MPH或M文件
comsol mph                    : 运行COMSOL并行模式(multiprocessing daemon)
2. <options>
-h                            : 屏显HELP
<target> -h                    : 屏显<target>的HELP
-32                            : 32位模式
-64                            :64位模式
-3drend ogl | sw              : OpenGL的3D渲染
-np <number>                  : 启动核数,WIN窗口模式默认启动全部核心,LIN则需要配置
-numasets <number>            : 非一致性内存访问 (NUMA)硬件可以通过将专用内存与 CPU 配对来显著提高性能,通常为CPU核sockets数
-mpmode throughput |          : 并行模式优化COMSOL与其他线程同时运行
turnaround  |          : 并行模式在无其他任务进行时,优化COMSOL进程          owner              : 并行模式在所有进程中,给予最高级的性能配置
-blas {auto}| mkl  |          :basic linear algebra operations,COMSOL很多计算引擎依赖BLAS
acml | path            : 使用BLAS库 mkl:intel的CPU,acml:AMD SSE2支持的CPU
-blaspath <path>              : BLAS库路径,与-blas path联用(环境变量为LD_LIBRARY_PATH)
-ipv6                          : IPV6支持
-nn <number>                  : 节点数
-nnhost <number>              :每个HOST使用的节点数
-mpi {auto} | intel |
mpich2 | wccs2003 |
whpc2008 | user| path        :调用MPI库
-mpipath <path>                : MPI库路径
-mpiroot <path>                : MPI库root路径
-
mpirsh {rsh} | ssh            : 在MPD模式下使用rsh或ssh
-scalapack {auto} |
mpich2 | wccs2003 |
whpc2008 | user | path        :Scalapcak库
-scalapackpath <path>          : Scalpack库路径
-clusersimple                  :Simple cluser模式不知是神马
-prefsdir <path>              : 配置属性路径
-tmpdir <path>                : 临时文件路径
-version                      : 屏显版本号
-ckl                          : 使用class-kit 许可
-forcegcc                      : 强制加载GCC库,通常是在联用MATLAB,而函数无法返回MATLAB时使用
-
forcecomsolgcc                :与COMSOL强制加载GCC库,COMSOL通常默认使用系统GCC,当在无法正常启动COMSOL时,尝试使用该命令
3. COMSOL SERVER 命令
通用格式
comsol [<options>] server [<target arguments>]
comsol target arguments
-user <user>                  : login user name
-port <port>                  : TCP/IP port to listen
-passwd <reset/nostore>        : 当需要提供新密码时使用,如果不需要存储新密码联用nostore
-login <{info}/force/never>    : 查询登录信息
-multi on | {off}              : 允许client重复链接
-silent                        : 不接受标准输入
-graphics                      : 启动COMSOL的图形库,不在COMSOL的GUI下,但是是COMSOL的绘图模式
4. COMSOL CLIENT 命令
通用格式
comsol [<options>] client [<target arguments>]
-port <port>                  : 指定连接的端口
-server <server name>          :连接的server名
5. COMSOL BATCH 命令
COMSOL的无GUI模式,可以运行MPH算例及模型JAVA文件,模型JAVA文件运行前需要编译。
通用格式
comsol [<options>] batch [<target arguments>]
<option>
-inputfile <file name>        : 运行一个MPH或java class文件
-outputfile <file name>        : 保存运算后的MPH文件,缺省时覆盖源文件
-job <job name>                : 运行COMSOL的study中batch任务
-study <study name>            : 运行COMSOL的study任务
-pnmae <parameter name>        : 参数化扫描变量名
-plist <parameter value>      : 参数化扫描变量值
-batchlog <file name>          : 保存batch的记录文件
-client                        : 以client模式运行
-host                          : 连接到HOST
-port                          : 连接到端口
-graphics                      : 启动COMSOL batch模式图形库以显示后处理图像
-
nosave                        : 不保存模型结果
example:
comsol batch -inputfile in.mph -outputfile out.mph -job b3 -pname v -plist 10输入in.mph输出out.mph,执行任务b3,参数v的值为10
6. COMSOL COMPILE 命令
通用格式
comsol [<options>] compile [<target arguments>] <file>.java
[<options>]
-jdkroot <path>                : JDK root路径
-classpathadd <classpath>      : additional classpath
-verbose                      : verbose输出
7. COMSOL CLUSTER 命令
通用格式
comsol -nn <no. of nodes> [<options>] [<target>] [<target arguments>]
COMSOL CLUSTER TARGETS
comsol -nn <nn> batch        :并行batch模式
comsol -nn <nn> server        :并行server模式
comsol -nn <nn>              :并行桌面模式
<
MPI mode下启动COMSOL,需要初始化MPI环境,MPD(Multiprocessing daemon)在每个节
点上运行。简单的做法是:
comsol -nn 4 -clustersimple
当以batch模式运行时,使用:
comsol -clustersimple batch -inputfile input.mph -outputfile output.mph
这样Intel MPI库会自动检测分配的节点数,-nn 指定节点数。这是最有效的运行COMSOL
方式。
对于单独cluster:
要在多个节点上运行MPD,需输入:
comsol -nn <number of computer node> mpd boot -f <filename>
<filename>中保存着运行程序节点的host names,每个Host name单独占一行,里面也可
以列出每个节点的IP地址。
通过comsol mpd trace来检测所有节点是否启动起来。
distributed COMSOL,这样server在多个节点上启动。计算的节点可以大于物理计算节点。通过-nnhost来强制某些计算的节点在一个物理计算节点上。避免启动计算的节点数大于
总物理核数。
comsol -nn <number> server
当完成了distributed COMSOL后,便可以关掉所有MPDs.
comsol mpd allexit
在一台计算机上启动MPD:
comsol mpd mpd &
这样可以使用一个多CPU计算机所有的计算节点。
而comsol mpd trace -l和comsol mpd mpd --port <number> --host <hostname>可以在每个节点上启动MPD,并且给它指定HOST和PORT。
使用--clustersimple自动启动和关闭MPD。它使用$HOME下mpd.host的配置文件。
EXAMPLE:
在一台电脑上启动MPD:
comsol mpd mpd &
comsol -nn 2 -np 3 可选
comsol -nn 2 -np 3 server 可选
comsol -nn 2 -np 3 batch -inputfile in.mph -outputfile out.mph
comsol mpd allexit
启动myhost中的多节点:
comsol -nn mpd boot -f myhosts
comsol mpd trace
comsol -nn 4
comsol -nn 4 server
comsol -nn 4 batch -inputfile in.mph -outputfile out.mph
comsol mpd allexit
启动简化版,调用的是mpd.hosts文件中的配置
comsol -nn 4 -clustersimple alternatively
comsol -nn 4 -clustersimple server alternatively
comsol -nn 4 -clustersimple batch -inputfile in.mph -outputfile out.mph
8. MPI选项
COMSOL支持基于MPICH2的大多数MPI,不过通常建议使用Intel MPI。
使用兼容模式加上 -mpi mpich2 (这里PATH和LD_LIBRARY_PATH要在系统变量中)
如调用其他版本的MPI,可以用 -mpipath -mpiroot来指定它们的位置。
9. MPD操作
boot
mpd
exit
allexit
cleanup
trace
check
ringtest
listjobs
sigjob
killjobs
tune
help
matlab 下载
10. COMSOL MATLAB 命令
comsole server matlab [<options>]
建立一个object:
model = ate(<name>);
其他方式:
comsol matlab [<options>]t(<host>,<port>); model = ate(<name>);
% work with your model
close
其他选项:
-mlroot <path>
-host <hostname>
-port <hostname>
-desktop                      :GUI模式
-nodesktop                    :无桌面模式
-mlnosplash
-compat                        : COMSOL 3.5a 兼容模式
-c35aroot                      : COMSOL 3.5a root路径
-graphics
11. COMSOL35a 转换命令
comsol [options] <input directory> <output directory> [log file]