• R/O
  • HTTP
  • SSH
  • HTTPS

Molby: コミット

Molecular Modeling Software


コミットメタ情報

リビジョン4363e0e639c3270d08257d800118a051b08f641a (tree)
日時2014-04-25 01:44:28
作者toshinagata1964 <toshinagata1964@a2be...>
コミッターtoshinagata1964

ログメッセージ

Running GAMESS causes trouble when the temporary directory has a whitespace within the path string (not working yet)

git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/molby/trunk@531 a2be9bc6-48de-4e38-9406-05402d4bc13c

変更サマリ

差分

--- a/Scripts/gamess.rb
+++ b/Scripts/gamess.rb
@@ -160,7 +160,7 @@ class Molecule
160160
161161 # Prepare the scratch directory in the home directory
162162 # (Not in the document home to avoid space-containing path in Windows)
163- scrdir = $home_directory + "/Molby/gamess"
163+ scrdir = $home_directory + "/Test Dir/Molby/gamess" # "Test Dir" for debug
164164 begin
165165 mkdir_recursive(scrdir)
166166 rescue
@@ -187,7 +187,7 @@ class Molecule
187187 # Get the host name etc.
188188 hostname = backquote("hostname").chomp
189189 if $platform == "win"
190- s = backquote("cmd.exe /c dir #{scrdir}")
190+ s = backquote("cmd.exe /c dir \"#{scrdir}\"")
191191 freebytes = s.split("\n").pop.match(/([0-9,]+)[^0-9]*$/).to_a[1]
192192 if freebytes
193193 freebytes = (freebytes.gsub(",","").to_i / 1024).to_s + " Kbytes"
@@ -388,7 +388,7 @@ class Molecule
388388 # File containing arguments to mpiexec
389389 procfil = "#{scrprefix}.processes.mpd"
390390 fp = File.open(procfil, "w")
391- fp.print "-env ENVFIL #{envfil} -wdir #{scrdir} -n #{ncpus*2} #{gmsdir}#{sep}gamess.#{gmsvers}.exe\n"
391+ fp.print "-env ENVFIL \"#{envfil}\" -wdir \"#{scrdir}\" -n #{ncpus*2} \"#{gmsdir}#{sep}gamess.#{gmsvers}.exe\"\n"
392392 fp.close
393393 end
394394 end
@@ -493,13 +493,13 @@ class Molecule
493493 if $platform == "win"
494494 if gmsvers == "11"
495495 hosts = "localhost " * ncpus
496- cmdline = "cmd.exe /c \"#{gmsdir}/ddikick.exe #{gmsdir}/gamess.#{gmsvers}.exe #{inpbody} -ddi #{ncpus} #{ncpus} #{hosts} -scr #{scrdir} < NUL >>#{logname}\""
496+ cmdline = "cmd.exe /c \"#{gmsdir}/ddikick.exe #{gmsdir}/gamess.#{gmsvers}.exe #{inpbody} -ddi #{ncpus} #{ncpus} #{hosts} -scr \\\"#{scrdir}\\\" < NUL >>\\\"#{logname}\\\""
497497 else
498- cmdline = "cmd.exe /c \"mpiexec -configfile #{procfil} >>#{logname}\""
498+ cmdline = "cmd.exe /c \"mpiexec -configfile \\\"#{procfil}\\\" >>\\\"#{logname}\\\""
499499 end
500500 else
501501 hosts = "localhost " * ncpus
502- cmdline = "/bin/sh -c '#{gmsdir}/ddikick.x #{gmsdir}/gamess.#{gmsvers}.x #{inpbody} -ddi #{ncpus} #{ncpus} #{hosts} -scr #{scrdir} < /dev/null >>#{logname}'"
502+ cmdline = "/bin/sh -c '\"#{gmsdir}/ddikick.x\" \"#{gmsdir}/gamess.#{gmsvers}.x\" #{inpbody} -ddi #{ncpus} #{ncpus} #{hosts} -scr \"#{scrdir}\" < /dev/null >>\"#{logname}\"'"
503503 end
504504
505505 if mol
--- a/wxSources/MyApp.cpp
+++ b/wxSources/MyApp.cpp
@@ -1474,13 +1474,15 @@ MyApp::CallSubProcess(const char *cmdline, const char *procname, int (*callback)
14741474
14751475 if (callback == DUMMY_CALLBACK) {
14761476 #if __WXMSW__
1477- /* Convert "\r\n" to "\n" */
1478- char *p, *pend;
1479- p = pend = membuf + strlen(membuf);
1480- while (--p >= membuf) {
1481- if (*p == '\r') {
1482- memmove(p, p + 1, pend - p);
1483- pend--;
1477+ if (membuf != NULL) {
1478+ /* Convert "\r\n" to "\n" */
1479+ char *p, *pend;
1480+ p = pend = membuf + strlen(membuf);
1481+ while (--p >= membuf) {
1482+ if (*p == '\r') {
1483+ memmove(p, p + 1, pend - p);
1484+ pend--;
1485+ }
14841486 }
14851487 }
14861488 #endif
旧リポジトリブラウザで表示