[yt-svn] commit/yt-3.0: MatthewTurk: Adding more info about skipping fields and whatnot inside RAMSES.

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Wed Jun 12 11:53:30 PDT 2013


1 new commit in yt-3.0:

https://bitbucket.org/yt_analysis/yt-3.0/commits/6f22f08f086a/
Changeset:   6f22f08f086a
Branch:      yt-3.0
User:        MatthewTurk
Date:        2013-06-12 20:53:04
Summary:     Adding more info about skipping fields and whatnot inside RAMSES.
Affected #:  2 files

diff -r d07242c7c90beb454362e7779ce2ae0790f7a69b -r 6f22f08f086adad2954c0efecd766713008bc66e yt/frontends/ramses/data_structures.py
--- a/yt/frontends/ramses/data_structures.py
+++ b/yt/frontends/ramses/data_structures.py
@@ -91,6 +91,7 @@
         hydro_offset = np.zeros(n_levels, dtype='int64')
         hydro_offset -= 1
         level_count = np.zeros(n_levels, dtype='int64')
+        skipped = []
         for level in range(self.amr_header['nlevelmax']):
             for cpu in range(self.amr_header['nboundary'] +
                              self.amr_header['ncpu']):
@@ -101,13 +102,15 @@
                 except AssertionError:
                     print "You are running with the wrong number of fields."
                     print "Please specify these in the load command."
+                    print "We are looking for %s fields." % self.nvar
+                    print "The last set of field sizes was: %s" % skipped
                     raise
                 if hvals['file_ncache'] == 0: continue
                 assert(hvals['file_ilevel'] == level+1)
                 if cpu + 1 == self.domain_id and level >= min_level:
                     hydro_offset[level - min_level] = f.tell()
                     level_count[level - min_level] = hvals['file_ncache']
-                fpu.skip(f, 8 * self.nvar)
+                skipped = fpu.skip(f, 8 * self.nvar)
         self._hydro_offset = hydro_offset
         self._level_count = level_count
         return self._hydro_offset

diff -r d07242c7c90beb454362e7779ce2ae0790f7a69b -r 6f22f08f086adad2954c0efecd766713008bc66e yt/utilities/fortran_utils.py
--- a/yt/utilities/fortran_utils.py
+++ b/yt/utilities/fortran_utils.py
@@ -158,7 +158,7 @@
     >>> f = open("fort.3", "rb")
     >>> skip(f, 3)
     """
-    skipped = 0
+    skipped = []
     pos = f.tell()
     for i in range(n):
         fmt = endian+"I"
@@ -167,7 +167,7 @@
         f.seek(s1+ struct.calcsize(fmt), os.SEEK_CUR)
         s2= struct.unpack(fmt, size)[0]
         assert s1==s2 
-        skipped += s1/struct.calcsize(fmt)
+        skipped.append(s1/struct.calcsize(fmt))
     return skipped
 
 def peek_record_size(f,endian='='):

Repository URL: https://bitbucket.org/yt_analysis/yt-3.0/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.



More information about the yt-svn mailing list