From c63d48cad7e03a70fe9e851dc871b26e1a33e696 Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Mon, 4 Jun 2007 15:27:10 -0500 Subject: [svn-r13833] Added a test case for the optimization of compound data reading fro the Chicago company. Tested on smirom and liberty because it's relatively simple. --- test/cmpd_dset.c | 107 +++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 101 insertions(+), 6 deletions(-) diff --git a/test/cmpd_dset.c b/test/cmpd_dset.c index 928a99d..08f1fd1 100644 --- a/test/cmpd_dset.c +++ b/test/cmpd_dset.c @@ -71,6 +71,20 @@ typedef struct s5_t { unsigned int post; } s5_t; +/* The sixth dataset (a superset of s1). This is for + * testing the optimization for the Chicago company. */ +typedef struct s6_t { + unsigned int a; + unsigned int b; + unsigned int c[4]; + unsigned int d; + unsigned int e; + unsigned int pre; + unsigned int mid1; + unsigned int mid2; + unsigned int post; +} s6_t; + #if 1 # define NX 100u @@ -124,6 +138,10 @@ main (int argc, char *argv[]) static s5_t s5[NX*NY]; hid_t s5_tid; + static s6_t s6[NX*NY]; + hid_t s6_tid; + + /* Sixth dataset */ /* Seventh dataset */ @@ -392,7 +410,84 @@ main (int argc, char *argv[]) /* *###################################################################### - * STEP 6: Update fields `b' and `d' on the file leaving the other + * STEP 6: Read all the members into a struct which has other members + * which have already been initialized. This is to test the + * optimization for the Chicago company. The optimization is + * for the special case when the source members are a subset of + * destination, and the order is the same, and no conversion + * is needed. For example: + * struct source { struct destination { + * TYPE1 A; --> TYPE1 A; + * TYPE2 B; --> TYPE2 B; + * TYPE3 C; --> TYPE3 C; + * }; TYPE4 D; + * TYPE5 E; + * }; + */ + TESTING("partially initialized superset optimized read"); + + /* Initialize some members */ + for (i=0; i