SIONlib  1.7.7
Scalable I/O library for parallel access to task-local files
sion_internal_startptr.c
Go to the documentation of this file.
1 /****************************************************************************
2 ** SIONLIB http://www.fz-juelich.de/jsc/sionlib **
3 *****************************************************************************
4 ** Copyright (c) 2008-2019 **
5 ** Forschungszentrum Juelich, Juelich Supercomputing Centre **
6 ** **
7 ** See the file COPYRIGHT in the package base directory for details **
8 ****************************************************************************/
9 
14 #define _XOPEN_SOURCE 700
15 
16 #include <assert.h>
17 #include <stdlib.h>
18 #include <stdio.h>
19 #include <stdarg.h>
20 #include <string.h>
21 #include <time.h>
22 
23 #include <sys/time.h>
24 
25 #include <sys/types.h>
26 #include <sys/stat.h>
27 #include <fcntl.h>
28 #include <errno.h>
29 
30 #include <unistd.h>
31 
32 #include "sion.h"
33 #include "sion_debug.h"
34 #include "sion_error_handler.h"
35 #include "sion_internal.h"
36 #include "sion_metadata.h"
37 #include "sion_filedesc.h"
38 #include "sion_tools.h"
39 #include "sion_fd.h"
40 #include "sion_file.h"
41 #include "sion_hints.h"
42 #include "sion_printts.h"
43 #include "sion_internal_startptr.h"
44 #include "sion_internal_collstat.h"
45 
46 /* INTERNAL */
47 
48 #define DFUNCTION "_sion_calculate_set_alignment"
49 sion_int64 _sion_calculate_set_alignment( _sion_filedesc *sion_filedesc, int t) {
50  sion_int64 lsize=SION_SIZE_NOT_VALID;
51 
52  /* alignment: fsv 3, WRITE: -> align lsize */
53  /* : fsv 3, READ: -> align lsize */
54  /* : fsv 4, WRITE: -> align lsize+chunksize */
55  /* : fsv 4, READ: -> lsize=chunksize */
56 
57  if (sion_filedesc->fileversion<=3) {
58  lsize = (sion_filedesc->all_chunksizes[t] % sion_filedesc->fsblksize == 0) ?
59  sion_filedesc->all_chunksizes[t] :
60  ((sion_filedesc->all_chunksizes[t] / sion_filedesc->fsblksize) + 1) * sion_filedesc->fsblksize;
61  DPRINTFP((2048, DFUNCTION, _SION_DEFAULT_RANK, "old file version (<=3) task=%d lsize=%ld\n", t, (long) lsize));
62  } else {
63  if (sion_filedesc->mode==SION_FILEMODE_WRITE) {
64  lsize = (sion_filedesc->all_chunksizes[t] % sion_filedesc->fsblksize == 0) ?
65  sion_filedesc->all_chunksizes[t] :
66  ((sion_filedesc->all_chunksizes[t] / sion_filedesc->fsblksize) + 1) * sion_filedesc->fsblksize;
67  /* expand chunksize for alignment */
68  sion_filedesc->all_chunksizes[t] = lsize;
69  DPRINTFP((2048, DFUNCTION, _SION_DEFAULT_RANK, "new file version (>3) task=%d lsize=%ld, WRITE chunksize set\n", t, (long) lsize));
70  } else {
71  lsize = sion_filedesc->all_chunksizes[t];
72  DPRINTFP((2048, DFUNCTION, _SION_DEFAULT_RANK, "new file version (>3) task=%d lsize=%ld, READ no align\n", t, (long) lsize));
73  }
74  }
75 
76  return(lsize);
77 }
78 #undef DFUNCTION
79 
86 #define DFUNCTION "_sion_get_size_metadatablock1"
87 int _sion_get_size_metadatablock1( _sion_filedesc *sion_filedesc )
88 {
89  int rc = 0;
90  int firstsize;
91 
92  /* calculate size of first block for meta-information */
93  firstsize = strlen(SION_ID) + 8 * sizeof(sion_int32) /* length of SION_ID + endianness+fsblksize+ntasks */
94  /* + nfiles+filenumber+3*versioninfo */
95  + SION_FILENAME_LENGTH /* prefix */
96  + sion_filedesc->ntasks * sizeof(sion_int64) + sion_filedesc->ntasks * sizeof(sion_int64) /* globalranks + chunksizes */
97  + sizeof(sion_int32) + 3 * sizeof(sion_int64); /* maxblocks + start_of_varheader + 2 x 64bit-flags */
98  rc=firstsize;
99 
100  return(rc);
101 }
102 #undef DFUNCTION
103 
110 #define DFUNCTION "_sion_calculate_startpointers"
111 int _sion_calculate_startpointers( _sion_filedesc *sion_filedesc )
112 {
113 
114  int rc = SION_SUCCESS;
115  int i, firstsize;
116  sion_int64 lsize;
117 
118  DPRINTFP((2, DFUNCTION, _SION_DEFAULT_RANK, "enter ntasks=%d fsblksize=%d chunksizes[0]=%lld\n",
119  sion_filedesc->ntasks, sion_filedesc->fsblksize, sion_filedesc->all_chunksizes[0]));
120 
121  firstsize=_sion_get_size_metadatablock1(sion_filedesc);
122 
123 #ifdef WFLARGEMETABLOCK
124  if (firstsize<4*1024*1024) firstsize=4*1024*1024;
125 #endif
126 
127  DPRINTFP((2, DFUNCTION, _SION_DEFAULT_RANK, "firstsize=%d\n", firstsize));
128 
129  sion_filedesc->all_startpointers[0] = (firstsize % sion_filedesc->fsblksize == 0) ?
130  firstsize :
131  ((firstsize / sion_filedesc->fsblksize) + 1) * sion_filedesc->fsblksize;
132 
133  i = 0;
134  DPRINTFP((2048, DFUNCTION, _SION_DEFAULT_RANK, " startpointers[%2d]=%10lld (%10.4fMB) chunksizes[%2d]=%8lld\n",
135  i, sion_filedesc->all_startpointers[i], sion_filedesc->all_startpointers[i] / 1024.0 / 1024.0, i, sion_filedesc->all_chunksizes[i]));
136  sion_filedesc->globalskip = 0;
137  for (i = 1; i < sion_filedesc->ntasks; i++) {
138 
139  lsize=_sion_calculate_set_alignment(sion_filedesc,i-1);
140 
141  sion_filedesc->globalskip += lsize;
142  sion_filedesc->all_startpointers[i] = sion_filedesc->all_startpointers[i - 1] + lsize;
143 
144 
145  DPRINTFP((2048, DFUNCTION, _SION_DEFAULT_RANK, " startpointers[%2d]=%10lld (%10.4fMB) chunksizes[%2d]=%8lld chunksizes[%2d]=%8lld\n",
146  i, sion_filedesc->all_startpointers[i], sion_filedesc->all_startpointers[i] / 1024.0 / 1024.0, i, sion_filedesc->all_chunksizes[i], i-1, sion_filedesc->all_chunksizes[i-1]));
147  }
148 
149  lsize=_sion_calculate_set_alignment(sion_filedesc,sion_filedesc->ntasks - 1);
150  sion_filedesc->globalskip += lsize;
151 
152  DPRINTFP((2, DFUNCTION, _SION_DEFAULT_RANK, "leave globalskip is %lld\n", sion_filedesc->globalskip));
153  return (rc);
154 }
155 #undef DFUNCTION
156 
157 
165 #define DFUNCTION "_sion_calculate_num_collector"
166 int _sion_calculate_num_collector( _sion_filedesc *sion_filedesc, _sion_collstat *collstat, int *num_collectors) {
167  int rc = SION_SUCCESS;
168  int max_num_collectors;
169 
170 
171  /* max. number: one fsblksize per collector */
172  max_num_collectors = (int) (collstat->gsize/sion_filedesc->fsblksize);
173  if(collstat->gsize%sion_filedesc->fsblksize>0) max_num_collectors++;
174  DPRINTFP((2, DFUNCTION, _SION_DEFAULT_RANK, "max_num_collectors=%d\n", max_num_collectors));
175 
176  if(sion_filedesc->collsize>0) {
177  /* user defined collsize (number of tasks per collector) */
178  *num_collectors = (int) (sion_filedesc->ntasks/sion_filedesc->collsize);
179  if(sion_filedesc->ntasks%sion_filedesc->collsize>0) (*num_collectors)++;
180 
181  /* limit the user specification */
182  if(*num_collectors > max_num_collectors) *num_collectors=max_num_collectors;
183 
184  DPRINTFP((32, DFUNCTION, _SION_DEFAULT_RANK, "user given collsize %d -> set num_collectors to %d\n",
185  sion_filedesc->collsize,*num_collectors));
186  } else {
187 
188  /* determine number of collectors by heuristic */
189  *num_collectors = max_num_collectors;
190 
191  /* limit the user specification */
192  if(*num_collectors>sion_filedesc->ntasks) *num_collectors=sion_filedesc->ntasks;
193 
194  /* some heuristics */
195  if ((sion_filedesc->ntasks>=512) && (*num_collectors>32)) *num_collectors=32;
196  else if((sion_filedesc->ntasks>=256) && (*num_collectors>16)) *num_collectors=16;
197  else if((sion_filedesc->ntasks>=128) && (*num_collectors>8)) *num_collectors=8;
198  else if((sion_filedesc->ntasks>=64) && (*num_collectors>8)) *num_collectors=8;
199  else if((sion_filedesc->ntasks>=32) && (*num_collectors>8)) *num_collectors=8;
200  else if((sion_filedesc->ntasks>=16) && (*num_collectors>4)) *num_collectors=4;
201 
202  /* TODO: check I/O infrastructure characteristics for better values */
203 
204  DPRINTFP((2, DFUNCTION, _SION_DEFAULT_RANK, "SIONlib heuristic collsize=%d num_collectors=%d\n",
205  sion_filedesc->collsize, *num_collectors));
206  }
207 
208  /* data per collector */
209  collstat->avg_data_per_collector = (
210  (sion_int64) (collstat->gsize / *num_collectors)
211  / sion_filedesc->fsblksize
212  )
213  * sion_filedesc->fsblksize;
214 
215  if((collstat->gsize / *num_collectors)%sion_filedesc->fsblksize>0) collstat->avg_data_per_collector+=sion_filedesc->fsblksize;
216  DPRINTFP((32, DFUNCTION, _SION_DEFAULT_RANK, "avg_data_per_collectors=%ld\n",(long) collstat->avg_data_per_collector));
217 
218 
219  return(rc);
220 }
221 #undef DFUNCTION
222 
229 #define DFUNCTION "_sion_calculate_startpointers_collective"
230 int _sion_calculate_startpointers_collective( _sion_filedesc *sion_filedesc )
231 {
232 
233  int rc = SION_SUCCESS;
234  int i, firstsize, num_collectors, numsender, lastcoll, s;
235 
236  sion_int64 currentsize, aligned_size, startpointer;
237  _sion_collstat *collstat;
238 
239  DPRINTFP((2, DFUNCTION, _SION_DEFAULT_RANK, "enter ntasks=%d fsblksize=%d chunksizes[0]=%lld\n",
240  sion_filedesc->ntasks, sion_filedesc->fsblksize, sion_filedesc->all_chunksizes[0]));
241 
242  if (sion_filedesc->fileversion<=3) {
243  return(_sion_errorprint(SION_NOT_SUCCESS,_SION_ERROR_RETURN,
244  "_sion_calculate_startpointers_collective: files with old sionlib file format (<3) can not be read by collective calls, please use standard read calls, aborting ...\n"));
245  }
246 
247  /* statistics */
248  collstat=_sion_create_and_init_collstat(sion_filedesc);
249 
250  /* calculate size of first block for meta-information */
251  collstat->firstsize=firstsize=_sion_get_size_metadatablock1(sion_filedesc);
252  _sion_calculate_num_collector(sion_filedesc, collstat, &num_collectors);
253  collstat->req_num_collectors=num_collectors;
254 
255  DPRINTFP((2, DFUNCTION, _SION_DEFAULT_RANK, "firstsize=%d collsize=%d num_collectors=%d\n",
256  firstsize, sion_filedesc->collsize, num_collectors));
257 
258  numsender=1;lastcoll=0;
259  currentsize=sion_filedesc->all_chunksizes[0];
260 
261  /* 1ST STEP: calculate mapping to collectors */
262  for (i = 1; i < sion_filedesc->ntasks; i++) {
263  if( (currentsize+sion_filedesc->all_chunksizes[i]<=collstat->avg_data_per_collector) ||
264  (sion_filedesc->all_coll_capability[i]==SION_CAPABILITY_ONLY_SENDER ) ) {
265  /* task will add to last collector */
266  currentsize +=sion_filedesc->all_chunksizes[i];
267  numsender++;
268  } else { /* new collector needed */
269 
270  /* adjust last senders */
271  for(s=lastcoll;s<i;s++) {
272  sion_filedesc->all_coll_collector[s]=lastcoll;
273  sion_filedesc->all_coll_collsize[s] =numsender;
274  }
275 
276  /* expand last one of group to align next one */
277  if (sion_filedesc->mode==SION_FILEMODE_WRITE) {
278  aligned_size = ((sion_int64) currentsize/sion_filedesc->fsblksize) * sion_filedesc->fsblksize;
279  if(currentsize%sion_filedesc->fsblksize>0) aligned_size+=sion_filedesc->fsblksize;
280 
281  DPRINTFP((128, DFUNCTION, _SION_DEFAULT_RANK, " align chunksizes[%2d]=%8lld + %lld\n",
282  i-1, sion_filedesc->all_chunksizes[i-1], aligned_size-currentsize));
283 
284  sion_filedesc->all_chunksizes[i-1]+=aligned_size-currentsize;
285  }
286 
287  /* init data for next collector */
288  numsender = 1; lastcoll= i; currentsize = sion_filedesc->all_chunksizes[i];
289  }
290  }
291 
292  /* align last sender */
293  if (sion_filedesc->mode==SION_FILEMODE_WRITE) {
294  aligned_size = ((sion_int64) currentsize/sion_filedesc->fsblksize) * sion_filedesc->fsblksize;
295  if(currentsize%sion_filedesc->fsblksize>0) aligned_size+=sion_filedesc->fsblksize;
296  DPRINTFP((128, DFUNCTION, _SION_DEFAULT_RANK, " align chunksizes[%2d]=%8lld + %lld\n",
297  sion_filedesc->ntasks-1, sion_filedesc->all_chunksizes[sion_filedesc->ntasks-1], aligned_size-currentsize));
298  sion_filedesc->all_chunksizes[sion_filedesc->ntasks-1]+=aligned_size-currentsize;
299  }
300 
301  /* adjust sender of last collector */
302  for(s=lastcoll;s<sion_filedesc->ntasks;s++) {
303  sion_filedesc->all_coll_collector[s]=lastcoll;
304  sion_filedesc->all_coll_collsize[s]=numsender;
305  }
306 
307  /* 2ND STEP: calculate startpointers */
308 
309  /* align first, not necessary, only for debugging */
310  /* startpointer=firstsize; */
311  startpointer = (firstsize % sion_filedesc->fsblksize == 0) ? firstsize : ((firstsize / sion_filedesc->fsblksize) + 1) * sion_filedesc->fsblksize;
312  sion_filedesc->globalskip = 0;
313  /* calculate mapping to collectors */
314  for (i = 0; i < sion_filedesc->ntasks; i++) {
315  sion_filedesc->all_startpointers[i] = startpointer;
316  startpointer += sion_filedesc->all_chunksizes[i];
317  sion_filedesc->globalskip += sion_filedesc->all_chunksizes[i];
318  }
319 
320  /* statistics */
321  if(sion_filedesc->colldebug>=1) {
322  _sion_update_collstat(collstat,sion_filedesc);
323  _sion_print_collstat(collstat, sion_filedesc);
324  }
325 
326  _sion_debugprint_collstat(collstat, sion_filedesc);
327 
328  _sion_destroy_collstat(collstat);
329 
330  DPRINTFP((2, DFUNCTION, _SION_DEFAULT_RANK, "leave globalskip is %lld\n", sion_filedesc->globalskip));
331  return (rc);
332 }
333 #undef DFUNCTION
334 
335 int _sion_calculate_startpointers_collective_msa(_sion_filedesc *fd)
336 {
337  DPRINTFP((2, __func__, _SION_DEFAULT_RANK, "enter ntasks=%d fsblksize=%d chunksizes[0]=%lld\n", fd->ntasks, fd->fsblksize, fd->all_chunksizes[0]));
338 
339  if (fd->fileversion<=3) {
340  return(_sion_errorprint(SION_NOT_SUCCESS,_SION_ERROR_RETURN,
341  "_sion_calculate_startpointers_collective_msa: files with old sionlib file format (<3) can not be read by collective calls, please use standard read calls, aborting ...\n"));
342  }
343 
344  sion_int64 firstsize = _sion_get_size_metadatablock1(fd);
345  sion_int64 startpointer = (firstsize % fd->fsblksize == 0) ? firstsize : ((firstsize / fd->fsblksize) + 1) * fd->fsblksize;
346  for (int i = 0; i < fd->ntasks; i++) {
347  assert(i % fd->collsize != 0 || startpointer % fd->fsblksize == 0);
348  fd->all_startpointers[i] = startpointer;
349  fd->all_coll_collector[i] = (i / fd->collsize) * fd->collsize;
350  if (fd->ntasks - i < fd->ntasks % fd->collsize) {
351  fd->all_coll_collsize[i] = fd->ntasks % fd->collsize;
352  } else {
353  fd->all_coll_collsize[i] = fd->collsize;
354  }
355  if ((i % fd->collsize == fd->all_coll_collsize[i] - 1) && (fd->mode == SION_FILEMODE_WRITE)) {
356  sion_int64 end_of_block = startpointer + fd->all_chunksizes[i];
357  if (end_of_block % fd->fsblksize != 0) {
358  fd->all_chunksizes[i] += fd->fsblksize - (end_of_block % fd->fsblksize);
359  }
360  }
361  startpointer += fd->all_chunksizes[i];
362  DPRINTFP((2, __func__, _SION_DEFAULT_RANK, "chunk: %d, collector: %d, collsize: %d, start: %lld, chunksize: %lld\n", i, fd->all_coll_collector[i], fd->all_coll_collsize[i], fd->all_startpointers[i], fd->all_chunksizes[i]));
363  }
364 
365  fd->globalskip = startpointer - fd->all_startpointers[0];
366  DPRINTFP((2, __func__, _SION_DEFAULT_RANK, "leave globalskip is %lld\n", fd->globalskip));
367  assert(fd->globalskip % fd->fsblksize == 0);
368 
369  return SION_SUCCESS;
370 }
371 
378 #define DFUNCTION "_sion_calculate_startpointers_collective_merge"
379 int _sion_calculate_startpointers_collective_merge( _sion_filedesc *sion_filedesc )
380 {
381 
382  int rc = SION_SUCCESS;
383  int i, firstsize, num_collectors, numsender, lastcoll, s;
384 
385  sion_int64 currentsize, newsize, aligned_size, startpointer;
386  _sion_collstat *collstat;
387 
388  DPRINTFP((2, DFUNCTION, _SION_DEFAULT_RANK, "enter ntasks=%d fsblksize=%d chunksizes[0]=%lld\n",
389  sion_filedesc->ntasks, sion_filedesc->fsblksize, sion_filedesc->all_chunksizes[0]));
390 
391  if (sion_filedesc->fileversion<=3) {
392  return(_sion_errorprint(SION_NOT_SUCCESS,_SION_ERROR_RETURN,
393  "_sion_calculate_startpointers_collective: files with old sionlib file format (<3) can not be read by collective calls, please use standard read calls, aborting ...\n"));
394  }
395 
396  /* statistics */
397  collstat=_sion_create_and_init_collstat(sion_filedesc);
398 
399  /* calculate size of first block for meta-information */
400  collstat->firstsize=firstsize=_sion_get_size_metadatablock1(sion_filedesc);
401  _sion_calculate_num_collector(sion_filedesc, collstat, &num_collectors);
402  collstat->req_num_collectors=num_collectors;
403 
404  DPRINTFP((2, DFUNCTION, _SION_DEFAULT_RANK, "firstsize=%d collsize=%d num_collectors=%d\n",
405  firstsize, sion_filedesc->collsize, num_collectors));
406 
407  numsender=1;lastcoll=0;
408  currentsize=sion_filedesc->all_chunksizes[0];
409 
410  DPRINTFP((128, DFUNCTION, _SION_DEFAULT_RANK, " currentsize=%lld chunksizes[%2d]=%8lld\n",
411  currentsize, 0, sion_filedesc->all_chunksizes[0]));
412 
413  /* 1ST STEP: calculate mapping to collectors */
414  for (i = 1; i < sion_filedesc->ntasks; i++) {
415  if( (currentsize+sion_filedesc->all_chunksizes[i]<=collstat->avg_data_per_collector) ||
416  (sion_filedesc->all_coll_capability[i]==SION_CAPABILITY_ONLY_SENDER ) ) {
417  /* task will add to last collector */
418  currentsize +=sion_filedesc->all_chunksizes[i];
419  numsender++;
420  DPRINTFP((128, DFUNCTION, _SION_DEFAULT_RANK, " currentsize=%lld chunksizes[%2d]=%8lld\n",
421  currentsize, i, sion_filedesc->all_chunksizes[i]));
422  } else { /* new collector needed */
423 
424 
425  /* increase chunksize of last collector */
426  if (sion_filedesc->mode==SION_FILEMODE_WRITE) {
427  newsize=currentsize;
428 
429  /* expand chunksize to align next one */
430  aligned_size = ((sion_int64) newsize/sion_filedesc->fsblksize) * sion_filedesc->fsblksize;
431  if(newsize%sion_filedesc->fsblksize>0) aligned_size+=sion_filedesc->fsblksize;
432 
433  DPRINTFP((128, DFUNCTION, _SION_DEFAULT_RANK, " resize chunksizes[%2d]=%8lld + %lld\n",
434  lastcoll, sion_filedesc->all_chunksizes[lastcoll], aligned_size-sion_filedesc->all_chunksizes[lastcoll]));
435  sion_filedesc->all_chunksizes[lastcoll]=aligned_size;
436 
437  for(s=lastcoll+1;s<i;s++) {
438  /* leave chunksize of sender on aligned original size to
439  allow storing data in intermeadiate non-collective
440  flushes */
441  _sion_calculate_set_alignment(sion_filedesc,s);
442 
443  /* adjust chunksize of the sender to one file system block as spare space */
444  /* sion_filedesc->all_chunksizes[s]=sion_filedesc->fsblksize; */
445  }
446 
447  }
448 
449  /* adjust last senders */
450  for(s=lastcoll;s<i;s++) {
451  sion_filedesc->all_coll_collector[s]=lastcoll;
452  sion_filedesc->all_coll_collsize[s] =numsender;
453  }
454 
455  /* init data for next collector */
456  numsender = 1; lastcoll= i; currentsize = sion_filedesc->all_chunksizes[i];
457  }
458  }
459 
460  /* align last sender */
461  if (sion_filedesc->mode==SION_FILEMODE_WRITE) {
462  newsize=currentsize;
463 
464  /* expand chunksize to align next one */
465  aligned_size = ((sion_int64) newsize/sion_filedesc->fsblksize) * sion_filedesc->fsblksize;
466  if(newsize%sion_filedesc->fsblksize>0) aligned_size+=sion_filedesc->fsblksize;
467 
468  DPRINTFP((128, DFUNCTION, _SION_DEFAULT_RANK, " resize chunksizes[%2d]=%8lld + %lld\n",
469  lastcoll, sion_filedesc->all_chunksizes[lastcoll], aligned_size-sion_filedesc->all_chunksizes[lastcoll]));
470  sion_filedesc->all_chunksizes[lastcoll]=aligned_size;
471 
472  /* adjust chunksize of the sender to one file system block as spare space */
473  for(s=lastcoll+1;s<i;s++) {
474  /* leave chunksize of sender on aligned original size to
475  allow storing data in intermeadiate non-collective
476  flushes */
477  _sion_calculate_set_alignment(sion_filedesc,s);
478 
479  /* adjust chunksize of the sender to one file system block as spare space */
480  /* sion_filedesc->all_chunksizes[s]=sion_filedesc->fsblksize; */
481  }
482  }
483 
484  /* adjust sender of last collector */
485  for(s=lastcoll;s<sion_filedesc->ntasks;s++) {
486  sion_filedesc->all_coll_collector[s]=lastcoll;
487  sion_filedesc->all_coll_collsize[s]=numsender;
488  }
489 
490  /* 2ND STEP: calculate startpointers */
491 
492  /* align first, not necessary, only for debugging */
493  /* startpointer=firstsize; */
494  startpointer = (firstsize % sion_filedesc->fsblksize == 0) ? firstsize : ((firstsize / sion_filedesc->fsblksize) + 1) * sion_filedesc->fsblksize;
495  sion_filedesc->globalskip = 0;
496  /* calculate mapping to collectors */
497  for (i = 0; i < sion_filedesc->ntasks; i++) {
498  sion_filedesc->all_startpointers[i] = startpointer;
499  startpointer += sion_filedesc->all_chunksizes[i];
500  sion_filedesc->globalskip += sion_filedesc->all_chunksizes[i];
501  }
502 
503  /* statistics */
504  if(sion_filedesc->colldebug>=1) {
505  _sion_update_collstat(collstat,sion_filedesc);
506  _sion_print_collstat(collstat, sion_filedesc);
507  }
508 
509  _sion_debugprint_collstat(collstat, sion_filedesc);
510 
511  _sion_destroy_collstat(collstat);
512 
513  DPRINTFP((2, DFUNCTION, _SION_DEFAULT_RANK, "leave globalskip is %lld\n", sion_filedesc->globalskip));
514  return (rc);
515 }
516 #undef DFUNCTION
517 
518 
519 
#define SION_FILEMODE_WRITE
Definition: sion_filedesc.h:38
#define SION_CAPABILITY_ONLY_SENDER
Definition: sion_filedesc.h:55
#define DFUNCTION
Calculates the size of the first meta data block.
#define SION_ID
Definition: sion_metadata.h:14
Sion Time Stamp Header.
Sion File Descriptor Structure.
Definition: sion_filedesc.h:79
sion_int32 * all_coll_collsize
sion_int32 * all_coll_collector
sion_int64 * all_chunksizes
sion_int32 * all_coll_capability
sion_int64 * all_startpointers