SIONlib  1.7.7
Scalable I/O library for parallel access to task-local files
partest_opts.c
1 /****************************************************************************
2 ** SIONLIB http://www.fz-juelich.de/jsc/sionlib **
3 *****************************************************************************
4 ** Copyright (c) 2008-2019 **
5 ** Forschungszentrum Juelich, Juelich Supercomputing Centre **
6 ** **
7 ** Copyright (c) 2019 **
8 ** DataDirect Networks **
9 ** **
10 ** See the file COPYRIGHT in the package base directory for details **
11 ****************************************************************************/
12 
13 #define _XOPEN_SOURCE 700
14 
15 #include <stdio.h>
16 #include <stdlib.h>
17 #include <string.h>
18 #include <ctype.h>
19 #include <unistd.h>
20 #include <mpi.h>
21 #include <time.h>
22 #include <math.h>
23 #ifdef _SION_AIX
24 #include "getopt_long.h"
25 #else
26 #include <getopt.h>
27 #endif
28 #include "sion.h"
29 #include "partest_opts.h"
30 #include "partest.h"
31 
32 int init_options ( _test_options *options) {
33  int rc=0;
34 
35  options->type = 0;
36  options->bluegene = 0;
37  options->bluegene_np = 0;
38  options->bluegene_sort = 0;
39  options->bufsize = 10 MB;
40  options->totalsize = 20 MB;
41  options->chunksize = options->totalsize;
42  options->fsblksize = 2.0 MB;
43  options->verbose = 0;
44  options->debug = 0;
45  options->Debug = 0;
46  options->numfiles = 1;
47  options->startoffset = 0;
48  options->read_task_offset = 0;
49  options->collectiveopenforread = 1;
50  options->collectivewrite = 0;
51  options->collectiveread = 0;
52  options->collmsa = 0;
53  options->unlink_files = 0;
54  options->suppress_checksum = 0;
55  options->serialize_blocknum = -1;
56  options->mpiio_lb = -1;
57  options->mpiio_bs = -1;
58  options->mpiio_sa = -1;
59  options->factor = 0.0;
60 
61  options->do_write = 1;
62  options->do_read = 1;
63  options->use_posix = 0;
64 #if defined(_SION_SIONFWD)
65  options->use_sionfwd = 0;
66 #endif
67 #ifdef _SION_IME_NATIVE
68  options->use_ime_native = 0;
69 #endif
70 
71  options->globalsize = -1;
72 
73  strcpy(options->filename, "partest_parfile.sion");
74 
75  return(rc);
76 }
77 
78 int parse_options_std ( int argc, char **argv, _test_options *options) {
79  int rc=0;
80  int i;
81 
82  /* parse command line */
83  i = 1;
84  while (i < argc) {
85  if (argv[i][0] == '-') {
86  switch (argv[i][1]) {
87  case 'f':
88  strcpy(options->filename, argv[++i]);
89  break;
90  case 'F':
91  options->factor = atof(argv[++i]);
92  break;
93  case 'n':
94  options->numfiles = atoi(argv[++i]);
95  break;
96  case 'b':
97  options->bufsize = (sion_int64) atoi(argv[++i]);
98  break;
99  case 'B':
100  options->bufsize = (sion_int64) atoi(argv[++i]) MB;
101  break;
102  case 'g':
103  options->globalsize = (sion_int64) atoi(argv[++i]);
104  break;
105  case 'G':
106  options->globalsize = (sion_int64) atoi(argv[++i]) * 1024 MB;
107  break;
108  case 'I':
109  options->do_write = 0;
110  break;
111  case 'O':
112  options->do_read = 0;
113  break;
114  case 'L':
115  options->use_posix = 1;
116  break;
117 #if defined(_SION_SIONFWD)
118  case 'l':
119  options->use_sionfwd = 1;
120  break;
121 #endif
122 #ifdef _SION_IME_NATIVE
123  case 'i':
124  options->use_ime_native = 1;
125  break;
126 #endif
127  case 's':
128  options->totalsize = (sion_int64) atoi(argv[++i]);
129  break;
130  case 'S':
131  options->totalsize = (sion_int64) atoi(argv[++i]) MB;
132  break;
133  case 'r':
134  options->chunksize = (sion_int64) atoi(argv[++i]);
135  break;
136  case 'R':
137  options->chunksize = (sion_int64) atoi(argv[++i]) MB;
138  break;
139  case 'q':
140  options->fsblksize = atoi(argv[++i]);
141  break;
142  case 'Q':
143  options->fsblksize = atof(argv[++i]) MB;
144  break;
145  case 'o':
146  options->startoffset = (sion_int64) atoi(argv[++i]);
147  break;
148  case 'P':
149  options->bluegene = 1;
150  break;
151  case 'p':
152  options->bluegene_np = atoi(argv[++i]);
153  break;
154  case 'T':
155  options->type = atoi(argv[++i]);
156  break;
157  case 'w':
158  options->mpiio_lb = atoi(argv[++i]);
159  break;
160  case 'W':
161  options->mpiio_bs = atoi(argv[++i]);
162  break;
163  case 'x':
164  options->mpiio_sa = atoi(argv[++i]);
165  break;
166  case 'Z':
167  options->read_task_offset = atoi(argv[++i]);
168  break;
169  case 'X':
170  options->unlink_files = atoi(argv[++i]);
171  break;
172  case 'j':
173  options->serialize_blocknum = atoi(argv[++i]);
174  break;
175  case 'C':
176  options->suppress_checksum = 1;
177  break;
178  case 'M':
179  options->collectivewrite++;
180  break;
181  case 'm':
182  options->collectiveread++;
183  break;
184  case 'c':
185  options->collmsa = 1;
186  break;
187  case 'd':
188  options->debug++;
189  break;
190  case 'D':
191  options->Debug++;
192  break;
193  case 'v':
194  options->verbose++;
195  break;
196  default:
197  printf("Arg default: %s\n", argv[i]);
198  usage(argv[0]);
199  }
200  }
201  else {
202  printf("Arg error: %s\n", argv[i]);
203  usage(argv[0]);
204  }
205  i++;
206  }
207 
208  return(rc);
209 }
210 
211 #if defined(_SION_SIONFWD)
212  #define SIONFWD_OPT_CHAR "l"
213 #else
214  #define SIONFWD_OPT_CHAR ""
215 #endif
216 
217 #ifdef _SION_IME_NATIVE
218  #define IME_NATIVE_OPT_CHAR "i"
219 #else
220  #define IME_NATIVE_OPT_CHAR ""
221 #endif
222 
223 int parse_options_long ( int argc, char **argv, _test_options *options) {
224  int rc=1;
225  int c;
226  int option_index = 0;
227  static struct option long_options[] = {
228  {"filename", required_argument, 0, 'f'},
229  {"numfiles", required_argument, 0, 'n'},
230  {"chunksize", required_argument, 0, 'r'},
231  {"fsblksize", required_argument, 0, 'q'},
232  {"testtype", required_argument, 0, 'T'},
233  {"bufsize", required_argument, 0, 'b'},
234  {"totalsize", required_argument, 0, 'g'},
235  {"localsize", required_argument, 0, 's'},
236  {"factor", required_argument, 0, 'F'},
237  {"write", required_argument, 0, 'W'},
238  {"read", required_argument, 0, 'R'},
239 
240  {"verbose", required_argument, 0, 'v'},
241  {"nochecksum",required_argument, 0, 'C'},
242  {"debugtask", required_argument, 0, 'd'},
243  {"Debugtask", required_argument, 0, 'D'},
244 
245  {"posix", required_argument, 0, 'L'},
246 #if defined(_SION_SIONFWD)
247  {"sionfwd", required_argument, 0, 'l'},
248 #endif
249 #ifdef _SION_IME_NATIVE
250  {"ime_native", required_argument, 0, 'i'},
251 #endif
252  {"collwrite", required_argument, 0, 'M'},
253  {"collread", required_argument, 0, 'm'},
254  {"collmsa", required_argument, 0, 'c'},
255 
256  {"taskoffset",required_argument, 0, 'Z'},
257  {"byteoffset",required_argument, 0, 'O'},
258  {"serialized",required_argument, 0, 'j'},
259  {"unlinkfiles",required_argument, 0, 'X'},
260  {"bgionode", required_argument, 0, 'P'},
261  {"bgtaskperionode", required_argument, 0, 'p'},
262  {"bgtasksort", required_argument, 0, 'Y'},
263  {"hintlargeblock", required_argument, 0, 'w'},
264  {"hintiobufsize", required_argument, 0, 'Q'},
265  {"hintsparseacess", required_argument, 0, 'x'},
266 
267 
268  {0, 0, 0, 0}
269  };
270 
271  while(1) {
272  c = getopt_long(argc, argv,
273  "f:n:r:q:T:b:g:s:F:W:R:vCdDL"
274  SIONFWD_OPT_CHAR IME_NATIVE_OPT_CHAR
275  "MmcZ:X:O:j:wQ:x",
276  long_options, &option_index);
277  if (c == -1)
278  break;
279 
280  switch (c) {
281  case 0:
282  printf("option %s", long_options[option_index].name);
283  if (optarg)
284  printf(" with arg %s", optarg);
285  printf("\n");
286  break;
287  case 'f':
288  strcpy(options->filename, optarg);
289  break;
290  case 'n':
291  options->numfiles = atoi(optarg);
292  break;
293  case 'r':
294  options->chunksize = to_bytes(optarg);
295  break;
296  case 'q':
297  options->fsblksize = to_bytes(optarg);
298  break;
299 
300  case 'T':
301  options->type = atoi(optarg);
302  break;
303  case 'b':
304  options->bufsize = to_bytes(optarg);
305  break;
306  case 'g':
307  options->globalsize = to_bytes(optarg);
308  break;
309  case 's':
310  options->totalsize = to_bytes(optarg);
311  break;
312  case 'F':
313  options->factor = atoi(optarg);
314  break;
315  case 'W':
316  options->do_write = atoi(optarg);
317  break;
318  case 'R':
319  options->do_read = atoi(optarg);
320  break;
321 
322  case 'v':
323  if(optarg) {
324  options->verbose = atoi(optarg);
325  } else options->verbose = 1;
326 
327  break;
328 
329  case 'C':
330  if(optarg) {
331  options->suppress_checksum = atoi(optarg);
332  } else options->suppress_checksum = 1;
333  break;
334 
335  case 'd':
336  if(optarg) {
337  options->debug = atoi(optarg);
338  } else options->debug = 1;
339  break;
340 
341  case 'D':
342  if(optarg) {
343  options->Debug = atoi(optarg);
344  } else options->Debug = 1;
345  break;
346 
347  case 'L':
348  if(optarg) {
349  options->use_posix = atoi(optarg);
350  } else options->use_posix = 1;
351  break;
352 
353 #if defined(_SION_SIONFWD)
354  case 'l':
355  if (optarg) {
356  options->use_sionfwd = atoi(optarg);
357  } else {
358  options->use_sionfwd = 1;
359  }
360  break;
361 #endif
362 
363 #ifdef _SION_IME_NATIVE
364  case 'i':
365  if (optarg) {
366  options->use_ime_native = atoi(optarg);
367  } else {
368  options->use_ime_native = 1;
369  }
370  break;
371 #endif
372 
373  case 'M':
374  if(optarg) {
375  options->collectivewrite = atoi(optarg);
376  } else options->collectivewrite = 1;
377  break;
378 
379  case 'm':
380  if(optarg) {
381  options->collectiveread = atoi(optarg);
382  } else options->collectiveread = 1;
383  break;
384 
385  case 'c':
386  options->collmsa = 1;
387  break;
388 
389  case 'Z':
390  options->read_task_offset = atoi(optarg);
391  break;
392 
393  case 'O':
394  options->startoffset = atoi(optarg);
395  break;
396 
397  case 'j':
398  options->serialize_blocknum = atoi(optarg);
399  break;
400 
401  case 'X':
402  if(optarg) {
403  options->unlink_files = atoi(optarg);
404  } else options->unlink_files = 1;
405  break;
406 
407  case 'P':
408  if(optarg) {
409  options->bluegene = atoi(optarg);
410  } else options->bluegene = 1;
411  break;
412 
413  case 'p':
414  options->bluegene_np = atoi(optarg);
415  break;
416 
417  case 'Y':
418  options->bluegene_sort = atoi(optarg);
419  break;
420 
421  case 'w':
422  if(optarg) {
423  options->mpiio_lb = atoi(optarg);
424  } else options->mpiio_lb = 1;
425  break;
426 
427  case 'Q':
428  options->mpiio_bs = atoi(optarg);
429  break;
430 
431  case 'x':
432  if(optarg) {
433  options->mpiio_sa = atoi(optarg);
434  } else options->mpiio_sa = 1;
435  break;
436 
437  default:
438  printf("?? getopt_long returned character code 0%o ??\n", c);
439  rc=0;
440  return(rc);
441  }
442  }
443 
444  return(rc);
445 }
446 
447 int distribute_options_mpi ( _test_options *options) {
448  int rc=0;
449 
450  MPI_Bcast(options->filename, FNAMELEN, MPI_CHAR, 0, MPI_COMM_WORLD);
451  MPI_Bcast(&options->factor, 1, MPI_DOUBLE, 0, MPI_COMM_WORLD);
452 
453  MPI_Bcast(&options->bufsize, 1, SION_MPI_INT64, 0, MPI_COMM_WORLD);
454  MPI_Bcast(&options->totalsize, 1, SION_MPI_INT64, 0, MPI_COMM_WORLD);
455  MPI_Bcast(&options->globalsize, 1, SION_MPI_INT64, 0, MPI_COMM_WORLD);
456  MPI_Bcast(&options->chunksize, 1, SION_MPI_INT64, 0, MPI_COMM_WORLD);
457  MPI_Bcast(&options->fsblksize, 1, SION_MPI_INT32, 0, MPI_COMM_WORLD);
458 
459  MPI_Bcast(&options->type, 1, MPI_INT, 0, MPI_COMM_WORLD);
460  MPI_Bcast(&options->verbose, 1, MPI_INT, 0, MPI_COMM_WORLD);
461  MPI_Bcast(&options->bluegene, 1, MPI_INT, 0, MPI_COMM_WORLD);
462  MPI_Bcast(&options->bluegene_np, 1, MPI_INT, 0, MPI_COMM_WORLD);
463  MPI_Bcast(&options->unlink_files, 1, MPI_INT, 0, MPI_COMM_WORLD);
464  MPI_Bcast(&options->serialize_blocknum, 1, MPI_INT, 0, MPI_COMM_WORLD);
465 
466  MPI_Bcast(&options->collectivewrite, 1, MPI_INT, 0, MPI_COMM_WORLD);
467  MPI_Bcast(&options->collectiveread, 1, MPI_INT, 0, MPI_COMM_WORLD);
468  MPI_Bcast(&options->collmsa, 1, MPI_INT, 0, MPI_COMM_WORLD);
469 
470  MPI_Bcast(&options->numfiles, 1, MPI_INT, 0, MPI_COMM_WORLD);
471  MPI_Bcast(&options->debug, 1, MPI_INT, 0, MPI_COMM_WORLD);
472  MPI_Bcast(&options->Debug, 1, MPI_INT, 0, MPI_COMM_WORLD);
473  MPI_Bcast(&options->read_task_offset, 1, MPI_INT, 0, MPI_COMM_WORLD);
474 
475  MPI_Bcast(&options->suppress_checksum, 1, MPI_INT, 0, MPI_COMM_WORLD);
476  MPI_Bcast(&options->do_read, 1, MPI_INT, 0, MPI_COMM_WORLD);
477  MPI_Bcast(&options->do_write, 1, MPI_INT, 0, MPI_COMM_WORLD);
478  MPI_Bcast(&options->use_posix, 1, MPI_INT, 0, MPI_COMM_WORLD);
479 #if defined(_SION_SIONFWD)
480  MPI_Bcast(&options->use_sionfwd, 1, MPI_INT, 0, MPI_COMM_WORLD);
481 #endif
482 #ifdef _SION_IME_NATIVE
483  MPI_Bcast(&options->use_ime_native, 1, MPI_INT, 0, MPI_COMM_WORLD);
484 #endif
485 
486  return(rc);
487 }
488 
489 
490 void usage_long(char *name) {
491 
492  fprintf(stderr, "Usage: %s options\n\n", name);
493  fprintf(stderr, "Options:\n");
494 
495  fprintf(stderr, " Sion File Settings:\n");
496  fprintf(stderr, " [-f filename] (--filename[=]) filename of direct access file\n");
497  fprintf(stderr, " [-n <number of files>] (--numfiles[=]) number of files (def: 1)\n");
498  fprintf(stderr, " [-r <chunksize>] (--chunksize[=]) sion chunk size (see size format)\n");
499  fprintf(stderr, " [-q <fsblksize>] (--fsblksize[=]) size of filesystem blocks (see\n");
500  fprintf(stderr, " size format)\n");
501 
502  fprintf(stderr, " Test Configuration:\n");
503  fprintf(stderr, " [-T <type>] (--testtype[=]) type of test\n");
504  fprintf(stderr, " (0:SION, standard),\n");
505  fprintf(stderr, " (1: SION:, independant read),\n");
506  fprintf(stderr, " (2:MPI IO), (3: Task-Local-File)\n");
507  fprintf(stderr, " [-b <bufsize>] (--bufsize[=]) size of blocks written in ONE\n");
508  fprintf(stderr, " fwrite (see size format)\n");
509  fprintf(stderr, " [-g <totalsize>] (--totalsize[=]) global total size of data written\n");
510  fprintf(stderr, " (see size format)\n");
511  fprintf(stderr, " [-s <localsize>] (--localsize[=]) local size of data written by each\n");
512  fprintf(stderr, " processor (see size format)\n");
513  fprintf(stderr, " [-F <factor>] (--factor[=]) factor for random size\n");
514  fprintf(stderr, " (0.0 to 1.0, def: 0.0)\n");
515  fprintf(stderr, " [-R (0|1)] (--read[=]) switch read off/on\n");
516  fprintf(stderr, " [-W (0|1|2)] (--write[=]) switch write off, on, or double\n");
517  fprintf(stderr, " write\n");
518 
519  fprintf(stderr, " Special Test Options:\n");
520  fprintf(stderr, " [-v] (--verbose[=](0|1)) verbose print info for each\n");
521  fprintf(stderr, " task\n");
522  fprintf(stderr, " [-C] (--nochecksum[=](0|1)) suppress checksum\n");
523  fprintf(stderr, " [-d] (--debugtask[=](0|1)) debug task 0\n");
524  fprintf(stderr, " [-D] (--Debugtask[=](0|1)) debug task n\n");
525  fprintf(stderr, " [-L] (--posix[=](0|1)) use POSIX calls instead of\n");
526  fprintf(stderr, " ANSI calls\n");
527 #if defined(_SION_SIONFWD)
528  fprintf(stderr, " [-l] (--sionfwd[=](0|1)) use I/O forwarding via SIONfwd\n");
529 #endif
530 #ifdef _SION_IME_NATIVE
531  fprintf(stderr, " [-i] (--ime_native[=](0|1)) use IME native calls instead of\n");
532  fprintf(stderr, " ANSI calls\n");
533 #endif
534  fprintf(stderr, " [-M] (--collwrite[=](0|1)) use collective write if\n");
535  fprintf(stderr, " possible\n");
536  fprintf(stderr, " [-m] (--collread[=](0|1)) use collective read if\n");
537  fprintf(stderr, " possible\n");
538  fprintf(stderr, " [-c] (--collmsa) optimize collective I/O for\n");
539  fprintf(stderr, " modular supercomputers\n");
540  fprintf(stderr, " [-Z <offset>] (--taskoffset[=]) shift tasks numbering for\n");
541  fprintf(stderr, " reading by offset to prevent\n");
542  fprintf(stderr, " data caching of file-system\n");
543  fprintf(stderr, " (default: 0)\n");
544  fprintf(stderr, " [-O <bytes>] (--byteoffset[=]) start offset, write <bytes>\n");
545  fprintf(stderr, " first before using blksize\n");
546  fprintf(stderr, " (default: 0)\n");
547  fprintf(stderr, " [-j <#tasks>] (--serialized[=]) serialize I/O, only I/O of\n");
548  fprintf(stderr, " #tasks are running in parallel\n");
549  fprintf(stderr, " (-1 -> all tasks in parallel,\n");
550  fprintf(stderr, " -2 -> use transactions,\n");
551  fprintf(stderr, " -def: -1)\n");
552  fprintf(stderr, " [-X] (--unlinkfiles[=](0|1)) remove files after test\n");
553 
554  fprintf(stderr, " Blue Gene/L, Blue Gene/P , Blue Gene/Q:\n");
555  fprintf(stderr, " [-P <mode>] (--bgionode[=](0|1|2)) order tasks by BG I/O-node\n");
556  fprintf(stderr, " (0 none, 1 ION, 2 IOB)\n");
557  fprintf(stderr, " [-Y <sort>] (--bgtaskperionode[=]) number of tasks per BG\n");
558  fprintf(stderr, " I/O-node\n");
559  fprintf(stderr, " [-p <numtasks>] (--bgtasksort[=](0|1)) sort task inside local\n");
560  fprintf(stderr, " communicator (0 distance to\n");
561  fprintf(stderr, " ION, 1 global rank)\n");
562 
563  fprintf(stderr, " MPI-IO, GPFS options:\n");
564  fprintf(stderr, " [-w] (--hintlargeblock[=](0|1)) Hint MPI-IO, IBM, Large\n");
565  fprintf(stderr, " Block IO\n");
566  fprintf(stderr, " [-Q <size>] (--hintiobufsize[=]) Hint MPI-IO, IBM, IO\n");
567  fprintf(stderr, " bufsize in KB\n");
568  fprintf(stderr, " [-x] (--hintsparseacess[=](0|1)) Hint MPI-IO, IBM, sparse\n");
569  fprintf(stderr, " access\n");
570 
571  fprintf(stderr, " Size Formats: <d>[k, K, kib, kiB, Kib, KiB] for kibi bytes\n");
572  fprintf(stderr, " <d>[kb, kB, Kb, KB] for kilo bytes\n");
573  fprintf(stderr, " similarly for [M, G, T]\n");
574 
575 }
576 
577 void usage(char *name) {
578 
579  fprintf(stderr, "Usage: %s options\n\n", name);
580  fprintf(stderr, "Options:\n\n");
581 
582  fprintf(stderr, " Sion File Settings:\n");
583  fprintf(stderr, " [-f filename] filename of direct access file\n");
584  fprintf(stderr, " [-n <number of files>] number of files\n");
585  fprintf(stderr, " [-r <chunksize>] sion chunk size in bytes\n");
586  fprintf(stderr, " [-R <chunksize>] sion chunk size in MBytes\n");
587  fprintf(stderr, " [-q <fsblksize>] size of filesystem blocks in bytes\n");
588  fprintf(stderr, " [-Q <fsblksize>] size of filesystem blocks in MBytes\n");
589 
590  fprintf(stderr, " Test Configuration:\n");
591  fprintf(stderr, " [-F <factor>] factor for random size (0.0 to 1.0, def: 0.0)\n");
592  fprintf(stderr, " [-b <bufsize>] size of blocks written in ONE fwrite in bytes\n");
593  fprintf(stderr, " [-B <bufsize>] size of blocks written in ONE fwrite in MBytes\n");
594  fprintf(stderr, " [-g <globaltotalsize>] global total size of data written in bytes\n");
595  fprintf(stderr, " [-G <globaltotalsize>] global total size of data written in GBytes\n");
596  fprintf(stderr, " [-s <totalsize>] total size of data written by each processor in bytes\n");
597  fprintf(stderr, " [-S <totalsize>] total size of data written by each processor in MBytes\n");
598  fprintf(stderr, " [-T <type>] type of test (0): w/o collective read; (2): MPI IO\n");
599  fprintf(stderr, " [-v] verbose print info for each task\n");
600  fprintf(stderr, " [-C] suppress checksum\n");
601  fprintf(stderr, " [-I] only read data\n");
602  fprintf(stderr, " [-O] only write data\n");
603  fprintf(stderr, " [-d] debug task 0\n");
604  fprintf(stderr, " [-D] debug task n\n");
605  fprintf(stderr, " [-L] use POSIX calls instead of ANSI call\n");
606  fprintf(stderr, " [-M] use collective write if possible\n");
607  fprintf(stderr, " [-m] use collective read if possible\n");
608  fprintf(stderr, " [-c] optimize collective I/O for modular supercomputers\n");
609  fprintf(stderr, " [-Z <offset>] shift tasks numbering for reading by offset to ommit\n");
610  fprintf(stderr, " data caching of file-system (default: 0)\n");
611  fprintf(stderr, " [-o <bytes>] start offset, write <bytes> first before using blksize\n");
612  fprintf(stderr, " (default: 0)\n");
613  fprintf(stderr, " [-j <#tasks>] serialize I/O, only I/O of #tasks are running in\n");
614  fprintf(stderr, " parallel (-1 -> all tasks in parallel, -2 -> use\n");
615  fprintf(stderr, " transactions, def: -1)\n");
616 
617  fprintf(stderr, " Blue Gene/L, Blue Gene/P , Blue Gene/Q:\n");
618  fprintf(stderr, " [-P <mode>] order tasks by BG I/O-node (0 none, 1 ION, 2 IOB)\n");
619  fprintf(stderr, " [-Y <sort>] number of tasks per BG I/O-node\n");
620  fprintf(stderr, " [-p <numtasks>] number of tasks per BG I/O-node\n");
621 
622  fprintf(stderr, " MPI-IO, GPFS options:\n");
623  fprintf(stderr, " [-w <1|0>] Hint MPI-IO, IBM, Large Block IO\n");
624  fprintf(stderr, " [-W <size>] Hint MPI-IO, IBM, IO bufsize in KB\n");
625  fprintf(stderr, " [-x <1|0>] Hint MPI-IO, IBM, sparse access\n");
626 
627  exit(1);
628 
629 }
630 
631 
632 /* convert following formats to bytes:
633  t,T,Ti,Tib,TiB -> 1024*1024*1024*1024 bytes
634  g,G,Gi,Gib,GiB -> 1024*1024*1024 bytes
635  m,M,Mi,Mib,MiB -> 1024*1024 bytes
636  k,K,Ki,Kib,KiB -> 1024 bytes
637 
638  Tb,TB -> 1000*1000*1000*1000 bytes
639  Gb,GB -> 1000*1000*1000 bytes
640  Mb,MB -> 1000*1000 bytes
641  Kb,KB -> 1000 bytes
642 */
643 sion_int64 to_bytes ( char *option) {
644  int rc;
645  sion_int64 size = -1;
646  sion_int64 factor = 1024;
647  char char1='\0',char2='\0',char3='\0';
648  rc = sscanf(option, "%lld%c%c%c", &size, &char1,&char2,&char3);
649  if (rc == 3 && ( (char2=='b') || (char2=='B') )) {
650  factor = 1000;
651  }
652 
653  if ( (char1=='T') || (char1=='t') ) size*=factor*factor*factor*factor;
654  if ( (char1=='G') || (char1=='g') ) size*=factor*factor*factor;
655  if ( (char1=='M') || (char1=='m') ) size*=factor*factor;
656  if ( (char1=='K') || (char1=='k') ) size*=factor;
657 
658  return size;
659 }