Skip to content
This repository has been archived by the owner on Apr 10, 2023. It is now read-only.

Commit

Permalink
Document metalayer changes in specs
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancescAlted committed Sep 9, 2019
1 parent afc305e commit b4d821c
Showing 1 changed file with 28 additions and 13 deletions.
41 changes: 28 additions & 13 deletions README_CATERVA_METALAYER.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ Caterva is storing persistently its information about shapes and partition shape

Caterva metalayer follows the msgpack format::

|-0-|-1-|-2-|~~~~~~~~~~~~~~~~|---|~~~~~~~~~~~~~~~~|
| 9X| nd| 9X| shape | 9X| partshape |
|---|---|---|~~~~~~~~~~~~~~~~|---|~~~~~~~~~~~~~~~~|
^ ^ ^ ^
| | | |
| | | +--[msgpack] positive fixnum for the number of dimensions (nd, up to 127)
| | +---[msgpack] fixarray with X=nd elements
| +------[msgpack] positive fixnum for the number of dimensions (nd, up to 127)
+---[msgpack] fixarray with X=3 elements
|-0-|-1-|-2-|-3-|~~~~~~~~~~~~~~~~|---|~~~~~~~~~~~~~~~~|---|~~~~~~~~~~~~~~~~|
| 9X| nd| nd| 9X| shape | 9X| partshape | 9X| blockshape |
|---|---|---|---|~~~~~~~~~~~~~~~~|---|~~~~~~~~~~~~~~~~|---|~~~~~~~~~~~~~~~~|
^ ^ ^ ^ ^ ^
| | | | | +--[msgpack] positive fixnum for nd
| | | | +--[msgpack] positive fixnum for nd
| | | +--[msgpack] fixarray with X=nd elements
| | +--[msgpack] positive fixnum for the number of dimensions (nd, up to 127)
| +--[msgpack] positive fixnum for the metalayer format version (up to 127)
+---[msgpack] fixarray with X=5 elements

The shape section
-----------------
Expand All @@ -26,8 +27,8 @@ This section is meant to store the actual shape info. There are as many fields
^ ^ ^
| | |
| | +--[msgpack] int64
| +------[msgpack] int64
+---[msgpack] int64
| +--[msgpack] int64
+--[msgpack] int64

The partshape section
---------------------
Expand All @@ -40,5 +41,19 @@ This section is meant to store the actual partition shape info. There are as ma
^ ^ ^
| | |
| | +--[msgpack] int32
| +------[msgpack] int32
+---[msgpack] int32
| +--[msgpack] int32
+--[msgpack] int32

The blockshape section
---------------------

This section is meant to store the block shape info inside the partition. There are as many fields as `nd` dimensions::

|---|--4 bytes---|---|--4 bytes---|~~~~~|---|--4 bytes---|
| d2| first_dim | d2| second_dim | ... | d2| last_dim |
|---|------------|---|------------|~~~~~|---|------------|
^ ^ ^
| | |
| | +--[msgpack] int32
| +--[msgpack] int32
+--[msgpack] int32

0 comments on commit b4d821c

Please sign in to comment.