Browse files

Fixed mbtools not to use polyBlock* anymore.

  • Loading branch information...
1 parent 2851824 commit 21642191af2caba29a82f3cf609e9289d65edf76 @pdiggins pdiggins committed with olenz Feb 17, 2014
Showing with 61 additions and 6 deletions.
  1. +30 −3 packages/mbtools/examples/scripts/main.tcl
  2. +4 −1 packages/mbtools/utils/setup.tcl
  3. +27 −2 packages/mbtools/utils/warmup.tcl
View
33 packages/mbtools/examples/scripts/main.tcl
@@ -255,8 +255,25 @@ for {set k $startk } { $k < $int_n_times } { incr k} {
# If k is a multiple of write_frequency then write out a full
# particle configuration
if { $k%$write_frequency==0 } {
- polyBlockWrite "$outputdir/$ident.[format %04d $j].gz" {time box_l npt_p_diff } {id pos type v f molecule}
- mmsg::send $this "wrote file $outputdir/$ident.[format %04d $j].gz "
+ #polyBlockWrite "$outputdir/$ident.[format %04d $j].gz" {time box_l npt_p_diff } {id pos type v f molecule}
+
+ set out [open "|gzip -c - > $outputdir/$ident.[format %04d $j].gz" "w"]
+ blockfile $out write start "variable"
+ puts $out "time [setmd time]"
+ blockfile $out write end
+ blockfile $out write start "variable"
+ puts $out "box_l $box_l"
+ blockfile $out write end
+ blockfile $out write start "variable"
+ puts $out "npt_p_diff [setmd npt_p_diff]"
+ blockfile $out write end
+
+ blockfile $out write interactions
+ blockfile $out write particles "id pos type p v f" all
+ blockfile $out write bonds all
+ close $out
+
+ mmsg::send $this "wrote file $outputdir/$ident.[format %04d $j].gz "
flush stdout
if { $use_vmd == "offline" } {
@@ -278,7 +295,17 @@ for {set k $startk } { $k < $int_n_times } { incr k} {
# Write a checkpoint to allow restarting. Overwrites previous
# checkpoint
mmsg::send $this "setting checkpoint $k [setmd time] $j"
- checkpoint_set "$outputdir/checkpoint.latest.gz"
+ #checkpoint_set "$outputdir/checkpoint.latest.gz"
+ set out [open "|gzip -c - > $outputdir/checkpoint.latest.gz" "w"]
+ blockfile $out write variable all
+ blockfile $out write tclvariable all
+ blockfile $out write interactions
+ blockfile $out write random
+ blockfile $out write bitrandom
+ blockfile $out write particles "id pos type p v f" all
+ blockfile $out write bonds all
+ blockfile $out write configs
+ close $out
# Try to copy a checkpoint to the backup checkpoint folder.
# Usefull if the program crashes while writing a checkpoint
View
5 packages/mbtools/utils/setup.tcl
@@ -144,7 +144,10 @@ proc ::mbtools::utils::readcheckpoint { checkpointdir } {
return 0
}
::mmsg::send [namespace current] "reading Checkpoint $checkpointdir/checkpoint.latest.gz"
- checkpoint_read "$checkpointdir/checkpoint" 0
+ #checkpoint_read "$checkpointdir/checkpoint" 0
+ set in [open "|gzip -cd $checkpointdir/checkpoint.latest.gz" "r"]
+ while { [blockfile $in read auto] != "eof" } {}
+ close $in
return 1
}
View
29 packages/mbtools/utils/warmup.tcl
@@ -82,7 +82,19 @@ proc ::mbtools::utils::warmup { steps times args } {
# Write out configuration files and pdb files
if { $i%$params(cfgs)==0 && ($params(cfgs) > 0 ) } {
- polyBlockWrite "$params(outputdir)/warm.[format %04d $warmcfg].gz" {time box_l npt_p_diff } {id pos type v f molecule}
+ #polyBlockWrite "$params(outputdir)/warm.[format %04d $warmcfg].gz" {time box_l npt_p_diff } {id pos type v f molecule}
+
+ set out [open "|gzip -c - > $params(outputdir)/warm.[format %04d $warmcfg].gz" "w"]
+ blockfile $out write variable all
+ blockfile $out write tclvariable all
+ blockfile $out write interactions
+ blockfile $out write random
+ blockfile $out write bitrandom
+ blockfile $out write particles "id pos type p v f" all
+ blockfile $out write bonds all
+ blockfile $out write configs
+ close $out
+
mmsg::send [namespace current] "wrote file $params(outputdir)/warm.[format %04d $warmcfg].gz "
flush stdout
@@ -161,7 +173,20 @@ proc ::mbtools::utils::nptwarmup { steps times iparms fparms args } {
# Write out configuration files and pdb files
if { $i%$params(cfgs)==0 && ($params(cfgs) > 0 ) } {
- polyBlockWrite "$params(outputdir)/warm.[format %04d $warmcfg].gz" {time box_l npt_p_diff } {id pos type v f molecule}
+ #polyBlockWrite "$params(outputdir)/warm.[format %04d $warmcfg].gz" {time box_l npt_p_diff } {id pos type v f molecule}
+
+ set out [open "|gzip -c - > $params(outputdir)/warm.[format %04d $warmcfg].gz" "w"]
+ blockfile $out write variable all
+ blockfile $out write tclvariable all
+ blockfile $out write interactions
+ blockfile $out write random
+ blockfile $out write bitrandom
+ blockfile $out write particles "id pos type p v f" all
+ blockfile $out write bonds all
+ blockfile $out write configs
+ close $out
+
+
mmsg::send [namespace current] "wrote file $params(outputdir)/warm.[format %04d $warmcfg].gz "
flush stdout

0 comments on commit 2164219

Please sign in to comment.