(file) Return to jretile_manytofew.c CVS log (file) (dir) Up to [Development] / JSOC / proj / globalhs / apps

  1 tplarson 1.1 #define MODES(L)        ((((L)+1)*(L))/2)
  2              #define MINIMUM(X,Y)    (((X)<(Y))?(X):(Y))
  3              #define MAXIMUM(X,Y)    (((X)>(Y))?(X):(Y))
  4              
  5              int jretile_manytofew(void)
  6              {
  7                int newstat = 0;
  8                int status = DRMS_SUCCESS;
  9                int fetchstat = DRMS_SUCCESS;
 10                DRMS_RecChunking_t chunkstat = kRecChunking_None;
 11              
 12                char *inrecquery = NULL;
 13                char *outseries = NULL;
 14                char *segnamein = NULL;
 15                char *segnameout = NULL;
 16                DRMS_RecordSet_t *inrecset = NULL;
 17                DRMS_RecordSet_t *outrecset = NULL;
 18                int irecin, irecout, nrecsin=0, nrecsout=0, nlchunks;
 19                DRMS_Record_t *inrec = NULL;
 20                DRMS_Record_t *outrec = NULL;
 21                DRMS_Segment_t *segin = NULL;
 22 tplarson 1.1   DRMS_Segment_t *segout = NULL;
 23                DRMS_Array_t *inarr = NULL;
 24                DRMS_Array_t *outarr = NULL;
 25                DRMS_RecLifetime_t lifetime;
 26                DRMS_Type_t usetype = DRMS_TYPE_FLOAT;
 27                int length[2], startind[2], endind[2], totallength[2];
 28                float *inptr, *outptr;
 29                long long histrecnum=-1;
 30                int quality;
 31                int mapmmax=-1;
 32                int sinbdivs=-1;
 33                double cadence=0;
 34              
 35                TIME tnow, UNIX_epoch = -220924792.000; /* 1970.01.01_00:00:00_UTC */
 36                char tstartstr[100], tscrstr[100];
 37              
 38                double tstart, tepoch, tstep, tround, tstop, tstartin, tstopin, tstepin, tstartuse, tstopuse, nseconds, chunksecs;
 39                char *ttotal, *tchunk;
 40                int ndt;
 41                int lmin, lmax, lminin, lmaxin, lminuse, lmaxuse, lchunk, lchunksize, lchunkfirst, lchunklast;
 42                int ntimechunks, nmodes, npts, imode, itime;
 43 tplarson 1.1   int out_time_offset, out_modes_offset, out_offset, in_time_offset, in_modes_offset, in_offset, out_index, in_index;
 44                int iset, lminout, lmaxout;
 45                double tstartout, tstopout;
 46                float *arrptr;
 47              
 48                int errbufstat=setvbuf(stderr, NULL, _IONBF, BUFSIZ);
 49                int outbufstat=setvbuf(stdout, NULL, _IONBF, BUFSIZ);
 50              
 51                double wt0, wt1, wt2, wt3, wt;
 52                double ut0, ut1, ut2, ut3, ut;
 53                double st0, st1, st2, st3, st;
 54                double ct0, ct1, ct2, ct3, ct;
 55              
 56                wt0=getwalltime();
 57                ct0=getcputime(&ut0, &st0);
 58              
 59                inrecquery = (char *)cmdparams_save_str(&cmdparams, "in", &newstat);
 60                outseries = (char *)cmdparams_save_str(&cmdparams, "out", &newstat);
 61                segnamein = (char *)cmdparams_save_str(&cmdparams, "segin", &newstat);
 62                segnameout = (char *)cmdparams_save_str(&cmdparams, "segout", &newstat);
 63                int seginflag = strcmp(kNOTSPECIFIED, segnamein);
 64 tplarson 1.1   int segoutflag = strcmp(kNOTSPECIFIED, segnameout);
 65                int verbflag = cmdparams_save_int(&cmdparams, "VERB", &newstat);
 66                int permflag = cmdparams_save_int(&cmdparams, "PERM", &newstat);
 67                if (permflag)
 68                  lifetime = DRMS_PERMANENT;
 69                else
 70                  lifetime = DRMS_TRANSIENT;
 71              
 72                char *histlinkname = (char *)cmdparams_save_str(&cmdparams, "histlink", &newstat);
 73              
 74                tstart=cmdparams_save_time(&cmdparams, "TSTART", &newstat);
 75                sprint_time(tstartstr, tstart, "TAI", 0);
 76                ttotal=(char *)cmdparams_save_str(&cmdparams, "TTOTAL", &newstat);
 77                status=drms_names_parseduration(&ttotal, &nseconds, 1);
 78                if (status)
 79                {
 80              //    newstat = newstat | CPSAVE_UNKNOWN_ERROR;
 81                  fprintf(stderr, "ERROR: problem parsing TTOTAL, = %s\n", ttotal);
 82                  return 1; 
 83                }
 84                tchunk=(char *)cmdparams_save_str(&cmdparams, "TCHUNK", &newstat);
 85 tplarson 1.1   if (strcmp(kNOTSPECIFIED, tchunk))
 86                {
 87                  status=drms_names_parseduration(&tchunk, &chunksecs, 1);
 88                  if (status)
 89                    newstat = newstat | CPSAVE_UNKNOWN_ERROR;
 90                }
 91                else
 92                  chunksecs=0;
 93              
 94                lmin=cmdparams_save_int(&cmdparams, "LMIN", &newstat);
 95                lmax=cmdparams_save_int(&cmdparams, "LMAX", &newstat);
 96                lchunksize=cmdparams_save_int(&cmdparams, "LCHUNK", &newstat);
 97                if (lchunksize == 0)
 98                  lchunksize=lmax+1;
 99              
100                if (newstat) 
101                {
102                  fprintf(stderr, "ERROR: problem with input arguments, status = %d, diagnosis follows\n", newstat);
103                  cpsave_decode_error(newstat);
104                  return 1;
105                }  
106 tplarson 1.1   else if (savestrlen != strlen(savestr)) 
107                {
108                  fprintf(stderr, "ERROR: problem with savestr, savestrlen = %d, strlen(savestr) = %d\n", savestrlen, (int)strlen(savestr));
109                  return 1;
110                }
111              
112                DRMS_Record_t *tempoutrec = drms_create_record(drms_env, 
113                                                               outseries,
114                                                               DRMS_TRANSIENT, 
115                                                               &status);
116              
117                if (status != DRMS_SUCCESS) 
118                {
119                 fprintf(stderr,"ERROR: couldn't open a record in output dataseries %s, status = %d\n", outseries, status);
120                 return 1;
121                }
122              
123              // set up ancillary dataseries for processing metadata
124 tplarson 1.2   char *cvsinfo = strdup("$Header: /home/cvsuser/cvsroot/JSOC/proj/globalhs/apps/jretile_manytofew.c,v 1.1 2012/05/09 03:53:22 tplarson Exp $");
125 tplarson 1.1   DRMS_Link_t *histlink = hcon_lookup_lower(&tempoutrec->links, histlinkname);
126                if (histlink != NULL) 
127                {
128                  histrecnum=set_history(histlink, cvsinfo);
129                  if (histrecnum < 0)
130                  {
131                    drms_close_record(tempoutrec, DRMS_FREE_RECORD);
132                    return 1;
133                  }
134                }
135                else
136                {
137                  fprintf(stderr,"WARNING: could not find history link in output dataseries\n");
138                }
139              
140              // these must be present in the output dataseries and variable, not links or constants
141              // now done in DoIt() that calls this function
142              /*
143                char *outchecklist[] = {"T_START", "QUALITY", "LMIN", "LMAX", "NDT"};
144                DRMS_Keyword_t *outkeytest;
145                int itest;
146 tplarson 1.1   for (itest=0; itest < ARRLENGTH(outchecklist); itest++)
147                {
148                  outkeytest = hcon_lookup_lower(&tempoutrec->keywords, outchecklist[itest]);
149                  if (outkeytest == NULL || outkeytest->info->islink || outkeytest->info->recscope == 1)
150                  {
151                    fprintf(stderr, "ERROR: output keyword %s is either missing, constant, or a link\n", outchecklist[itest]);
152                    drms_close_record(tempoutrec, DRMS_FREE_RECORD);
153                    return 1;
154                  }
155                }
156              */
157              
158                tepoch=drms_getkey_time(tempoutrec, "T_START_epoch", &status);
159                tstep=drms_getkey_float(tempoutrec, "T_START_step", &status);
160                tround=drms_getkey_float(tempoutrec, "T_START_round", &status);
161                cadence=drms_getkey_float(tempoutrec, "T_STEP", &status);
162                if (fmod(tstart-tepoch,tstep) > tround/2)
163                {
164                  sprint_time(tscrstr, tepoch, "TAI", 0);
165                  fprintf(stderr, "ERROR: output dataseries seems incompatible with input parameters (tstep must divide tstart-tepoch): TSTART = %s, T_START_epoch = %s, tstep = %f\n", 
166                                                                                                                                        tstartstr, tscrstr, tstep);
167 tplarson 1.1     drms_close_record(tempoutrec, DRMS_FREE_RECORD);
168                  return 1;
169                }
170                if (chunksecs == 0.0)
171                  chunksecs = tstep;
172                else if (fmod(chunksecs,tstep))
173                {
174                  fprintf(stderr, "ERROR: output dataseries seems incompatible with input parameters (tstep must divide chunksecs): chunksecs = %f, tstep = %f\n", chunksecs, tstep);
175                  drms_close_record(tempoutrec, DRMS_FREE_RECORD);
176                  return 1;
177                }
178                if (fmod(nseconds,chunksecs) != 0.0)
179                {
180                  fprintf(stderr, "ERROR: input parameters seem incompatible (chunksecs must divide totalsecs): totalsecs = %f, chunksecs = %f\n", nseconds, chunksecs);
181                  drms_close_record(tempoutrec, DRMS_FREE_RECORD);
182                  return 1;
183                }
184                ntimechunks=nseconds/chunksecs;
185                ndt=chunksecs/cadence;
186                if (verbflag)
187                {
188 tplarson 1.1     printf("%d timechunks, %.1f seconds per chunk\n", ntimechunks, chunksecs);
189                }
190              
191                int mapmmaxout=-1;
192                int sinbdivsout=-1;
193                DRMS_Keyword_t *outkeytest = hcon_lookup_lower(&tempoutrec->keywords, "MAPMMAX");
194                if (outkeytest != NULL && outkeytest->info->recscope == 1)
195                  mapmmaxout=drms_getkey_int(tempoutrec, "MAPMMAX", &status);
196                outkeytest = hcon_lookup_lower(&tempoutrec->keywords, "SINBDIVS");
197                if (outkeytest != NULL && outkeytest->info->recscope == 1)
198                  sinbdivsout=drms_getkey_int(tempoutrec, "SINBDIVS", &status);
199              
200                drms_close_record(tempoutrec, DRMS_FREE_RECORD);
201              
202                char *inchecklist[] = {"T_START", "QUALITY", "LMIN", "LMAX", "T_STEP"};
203                DRMS_Keyword_t *inkeytest;
204                int itest;
205                inrecset = drms_open_recordset(drms_env, inrecquery, &status);
206              //  inrecset = drms_open_records(drms_env, inrecquery, &status);
207              
208                if (status != DRMS_SUCCESS || inrecset == NULL)
209 tplarson 1.1   {
210                  fprintf(stderr, "ERROR: problem opening input recordset: status = %d\n", status);
211                  return 1;
212                }
213                nrecsin = inrecset->n;
214              
215                if (verbflag) 
216                  printf("input recordset opened, nrecs = %d\n", nrecsin);
217              
218                int noinput=0;
219                if (nrecsin == 0)
220                {
221                  printf("WARNING: input recordset contains no records\n");
222                  noinput=1;
223                  goto skip1;
224              //    return 1;
225                }
226              
227                inrec = drms_recordset_fetchnext(drms_env, inrecset, &fetchstat, &chunkstat, NULL);
228              //  inrec = inrecset->records[0];
229              
230 tplarson 1.1   for (itest=0; itest < ARRLENGTH(inchecklist); itest++)
231                {
232                  inkeytest = hcon_lookup_lower(&inrec->keywords, inchecklist[itest]);
233                  if (inkeytest == NULL)
234                  {
235                    fprintf(stderr, "ERROR: required input keyword %s is missing\n", inchecklist[itest]);
236                    drms_close_records(inrecset, DRMS_FREE_RECORD);
237                    return 1;
238                  }
239                }
240              
241                if (cadence != drms_getkey_float(inrec, "T_STEP", &status))
242                {
243                  fprintf(stderr, "ERROR: input T_STEP does not equal output T_STEP\n");
244                  drms_close_records(inrecset, DRMS_FREE_RECORD);
245                  return 1;
246                }
247              
248                inkeytest = hcon_lookup_lower(&inrec->keywords, "MAPMMAX");
249                if (inkeytest != NULL)
250                  mapmmax=drms_getkey_int(inrec, "MAPMMAX", &status);
251 tplarson 1.1   if (mapmmaxout != -1 && mapmmaxout != mapmmax)
252                {
253                  fprintf(stderr, "ERROR: input MAPMMAX does not equal output MAPMMAX, in=%d, out=%d\n", mapmmax, mapmmaxout);
254                  drms_close_records(inrecset, DRMS_FREE_RECORD);
255                  return 1;
256                }
257              
258                inkeytest = hcon_lookup_lower(&inrec->keywords, "SINBDIVS");
259                if (outkeytest != NULL)
260                  sinbdivs=drms_getkey_int(inrec, "SINBDIVS", &status);
261                if (sinbdivsout != -1 && sinbdivsout != sinbdivs)
262                {
263                  fprintf(stderr, "ERROR: input SINBDIVS does not equal output SINBDIVS, in=%d, out=%d\n", sinbdivs, sinbdivsout);
264                  drms_close_records(inrecset, DRMS_FREE_RECORD);
265                  return 1;
266                }
267              
268                status=drms_stage_records(inrecset, 1, 0);
269                if (status != DRMS_SUCCESS)
270                {
271                  fprintf(stderr, "ERROR: drms_stage_records returned status = %d\n", status);
272 tplarson 1.1     return 1;
273                }
274              
275                skip1:
276              
277                lchunkfirst = lmin/lchunksize;
278                lchunklast = lmax/lchunksize;
279              
280                nlchunks = (lchunklast - lchunkfirst) + 1;
281                nrecsout = nlchunks*ntimechunks;
282                outrecset = drms_create_records(drms_env, nrecsout, outseries, lifetime, &status);
283                if (status != DRMS_SUCCESS || outrecset == NULL)
284                {
285                  fprintf(stderr,"ERROR: unable to create records record in output dataseries %s, status = %d\n", outseries, status);
286                  drms_close_records(inrecset, DRMS_FREE_RECORD);
287                  return 1;
288                }
289              
290 tplarson 1.2 /*
291 tplarson 1.1   irecout=0;
292                for (iset=0; iset < ntimechunks; iset++)
293                {
294                  tstartout=tstart + iset * chunksecs;
295                  tstopout=tstartout+chunksecs;
296              
297                  for (lchunk = lchunkfirst; lchunk <= lchunklast; lchunk++)
298                  {
299                    lminout = lchunk * lchunksize; 
300                    lmaxout = lminout + lchunksize - 1;
301                    lminout = MAXIMUM(lminout,lmin);
302                    lmaxout = MINIMUM(lmaxout,lmax);
303              
304                    outrec = outrecset->records[irecout];
305                    if (histlink)
306                      drms_setlink_static(outrec, histlinkname,  histrecnum);
307                    drms_setkey_int(outrec, "LMIN", lminout);
308                    drms_setkey_int(outrec, "LMAX", lmaxout);
309                    drms_setkey_time(outrec, "T_START", tstartout);
310                    drms_setkey_time(outrec, "T_STOP", tstopout);
311                    drms_setkey_time(outrec, "T_OBS", tstartout+chunksecs/2);
312 tplarson 1.1       drms_setkey_int(outrec, "NDT", ndt);
313 tplarson 1.2 
314 tplarson 1.1       irecout++;
315                  }
316                }
317 tplarson 1.2 */
318 tplarson 1.1 
319 tplarson 1.2   int firsttimethrough=1;
320 tplarson 1.1   int *nskiparr=(int *)calloc(nrecsout,sizeof(int));
321                for (irecin=0; irecin < nrecsin; irecin++)
322                {
323              // move to end of loop when using drms_recordset_fetchnext(drms_env, inrecset, &fetchstat, &chunkstat, NULL);
324              //    inrec = inrecset->records[irecin]; 
325                  tstartin=drms_getkey_time(inrec, "T_START", &status);
326                  tstopin=drms_getkey_time(inrec, "T_STOP", &status);
327                  lminin=drms_getkey_int(inrec, "LMIN", &status);
328                  lmaxin=drms_getkey_int(inrec, "LMAX", &status);
329                  tstepin=tstopin-tstartin;
330              
331                  quality=drms_getkey_int(inrec, "QUALITY", &status);
332                  if (status != DRMS_SUCCESS || (quality & QUAL_NODATA)) //may want stricter test on quality here
333                  {
334                    if (verbflag > 2)
335                    {
336                      sprint_time(tscrstr, tstartin, "TAI", 0);
337                      fprintf(stderr, "WARNING: input data not used due to quality: T_START = %s, LMIN = %d, LMAX = %d, recnum = %lld, irec = %d, status = %d, quality = %08x\n", 
338                                                                                    tscrstr, lminin, lmaxin, inrec->recnum, irecin, status, quality);
339                    }
340                    for (irecout=0; irecout < nrecsout; irecout++)
341 tplarson 1.1         nskiparr[irecout]++;
342                    goto continue_outer_loop;
343              //      continue;
344                  }
345              
346                  if (seginflag)
347                    segin = drms_segment_lookup(inrec, segnamein);
348                  else
349                    segin = drms_segment_lookupnum(inrec, 0);
350                  if (segin)
351                    inarr = drms_segment_read(segin, usetype, &status);
352              //      inarr = drms_segment_readslice(segin, usetype, startind, endind, &status);
353                  if (status != DRMS_SUCCESS || inarr == NULL || segin == NULL)
354                  {
355                    sprint_time(tscrstr, tstartin, "TAI", 0);
356                    fprintf(stderr, "ERROR: problem reading input segment, T_START = %s, LMIN = %d, LMAX = %d, recnum = %lld, irec = %d, status = %d\n", 
357                                                                           tscrstr, lminin, lmaxin, inrec->recnum, irecin, status);
358                    drms_close_records(inrecset, DRMS_FREE_RECORD);
359                    drms_close_records(outrecset, DRMS_FREE_RECORD);
360                    return 0;
361                  }
362 tplarson 1.1     else
363                  {
364                    inptr=(float *)(inarr->data);
365                  }
366              
367                  irecout=0;
368                  for (iset=0; iset < ntimechunks; iset++)
369                  {
370                    tstartout=tstart + iset * chunksecs;
371                    tstopout=tstartout+chunksecs;
372                    sprint_time(tstartstr, tstartout, "TAI", 0);
373              
374                    for (lchunk = lchunkfirst; lchunk <= lchunklast; lchunk++)
375                    {
376                      lminout = lchunk * lchunksize; 
377                      lmaxout = lminout + lchunksize - 1;
378                      lminout = MAXIMUM(lminout,lmin);
379                      lmaxout = MINIMUM(lmaxout,lmax);
380 tplarson 1.2         outrec = outrecset->records[irecout];
381              
382                      if (firsttimethrough)
383                      {
384                        if (histlink)
385                          drms_setlink_static(outrec, histlinkname,  histrecnum);
386                        drms_copykeys(outrec, inrec, 0, kDRMS_KeyClass_Explicit);
387                        drms_setkey_int(outrec, "LMIN", lminout);
388                        drms_setkey_int(outrec, "LMAX", lmaxout);
389                        drms_setkey_time(outrec, "T_START", tstartout);
390                        drms_setkey_time(outrec, "T_STOP", tstopout);
391                        drms_setkey_time(outrec, "T_OBS", tstartout+chunksecs/2);
392                        drms_setkey_int(outrec, "NDT", ndt);
393                      }
394 tplarson 1.1 
395                      if (tstartin >= tstopout || tstopin <= tstartout || lminin > lmaxout || lmaxin < lminout)
396                      {
397                        nskiparr[irecout++]++;
398                        continue;
399                      }
400              
401                      if (segoutflag)
402                        segout = drms_segment_lookup(outrec, segnameout);
403                      else
404                        segout = drms_segment_lookupnum(outrec, 0);
405                      tstartuse=MAXIMUM(tstartout, tstartin);
406                      tstopuse= MINIMUM(tstopout, tstopin);
407                      lminuse=MAXIMUM(lminout, lminin);
408                      lmaxuse=MINIMUM(lmaxout, lmaxin);
409                      nmodes=MODES(lmaxuse+1)-MODES(lminuse);
410                      npts=(tstopuse - tstartuse)/cadence;
411              
412                      out_time_offset = (tstartuse - tstartout)/cadence;
413                      out_modes_offset = MODES(lminuse) - MODES(lminout);
414              //        out_offset = 2 * (out_modes_offset * ndt + out_time_offset);
415 tplarson 1.1         out_offset = 0; // 2 * (out_modes_offset * npts + out_time_offset);
416                      in_time_offset = (tstartuse - tstartin)/cadence;
417                      in_modes_offset = MODES(lminuse) - MODES(lminin);
418                      in_offset =  2 * (in_modes_offset * tstepin / cadence + in_time_offset);
419              
420                      startind[0]=2*out_time_offset;
421                      startind[1]=out_modes_offset;
422                      endind[0]=2*(out_time_offset + npts) - 1;
423                      endind[1]=out_modes_offset + nmodes - 1;
424                      totallength[0]=2*ndt;
425                      totallength[1]=lmaxout*(lmaxout+1)/2+lmaxout - lminout*(lminout+1)/2 + 1;
426              
427                      length[0]=2*npts;
428                      length[1]=nmodes;
429                      arrptr=(float *)(calloc(length[0]*length[1],sizeof(float)));
430                      outarr = drms_array_create(usetype, 2, length, arrptr, &status);
431                      if (status != DRMS_SUCCESS || outarr == NULL || arrptr == NULL)
432                      {
433 tplarson 1.2           fprintf(stderr,"ERROR: problem creating output array: T_START = %s, LMIN = %d, LMAX = %d, length = [%d, %d], status = %d, histrecnum = %lld\n", 
434 tplarson 1.1                                                                 tstartstr, lminout, lmaxout, length[0], length[1], status, histrecnum);
435                        drms_close_records(inrecset, DRMS_FREE_RECORD);
436                        drms_close_records(outrecset, DRMS_FREE_RECORD);
437                        return 0; 
438                      }
439                      outptr = (float *)(outarr->data);
440              
441                      for (imode=0; imode<nmodes; imode++)
442                      {
443                        for (itime=0; itime<npts; itime++)
444                        {
445                          in_index=in_offset + 2*itime;
446                          out_index=out_offset + 2*itime;
447                          outptr[out_index] = inptr[in_index];
448                          outptr[out_index+1] = inptr[in_index+1];
449                        }
450                        out_offset+=2*npts;    // 2*ndt;
451                        in_offset+=2*tstepin/cadence;
452                      }
453              
454                      status=drms_segment_writeslice_ext(segout, outarr, startind, endind, totallength, 0);
455 tplarson 1.1         if (status != DRMS_SUCCESS)
456                      {
457                        fprintf(stderr, "ERROR: problem writing output segment: status = %d, T_START = %s, LMIN = %d, LMAX = %d, histrecnum = %lld\n", 
458                                                                                status, tstartstr, lminout, lmaxout, histrecnum);
459                        drms_close_records(inrecset, DRMS_FREE_RECORD);
460                        drms_close_records(outrecset, DRMS_FREE_RECORD);
461                        return 0;
462                      }
463              
464                      drms_free_array(outarr);
465              
466                      irecout++;
467                    }  // end loop on lchunk
468                  }  // end loop on iset
469              
470 tplarson 1.2   firsttimethrough=0;
471                drms_free_array(inarr);
472 tplarson 1.1   continue_outer_loop:
473                inrec = drms_recordset_fetchnext(drms_env, inrecset, &fetchstat, &chunkstat, NULL);
474                }  // end loop on irecin
475              
476                drms_close_records(inrecset, DRMS_FREE_RECORD);
477              
478                int nsegments=0;
479                for (irecout=0; irecout < nrecsout; irecout++)
480                {
481                  outrec=outrecset->records[irecout];
482                  if (noinput || nskiparr[irecout] == nrecsin)
483                  {
484                    drms_setkey_int(outrec, "QUALITY", QUAL_NODATA);
485                  }
486                  else
487                  {
488                    drms_setkey_int(outrec, "QUALITY", 0);
489                    nsegments++;
490                  }
491              
492                  tnow = (double)time(NULL);
493 tplarson 1.1     tnow += UNIX_epoch;
494                  drms_setkey_time(outrec, "DATE", tnow);
495                }
496              
497                free(nskiparr);
498                drms_close_records(outrecset, DRMS_INSERT_RECORD);
499              
500                wt=getwalltime();
501                ct=getcputime(&ut, &st);
502                if (verbflag) 
503                {
504                  printf("number of records created  = %d\n", nrecsout);
505                  printf("number of segments created = %d\n", nsegments);
506                  fprintf(stdout, "total time spent: %.2f ms wall time, %.2f ms cpu time\n", 
507                          wt-wt0, ct-ct0);
508                }
509              
510                printf("module %s successful completion\n", cmdparams.argv[0]);
511              
512                return 0;
513              
514 tplarson 1.1 }

Karen Tian
Powered by
ViewCVS 0.9.4