MACSio  0.9
Multi-purpose, Application-Centric, Scalable I/O Proxy App
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
make_par_mesh.c
Go to the documentation of this file.
1 /*
2 Copyright (c) 2015, Lawrence Livermore National Security, LLC.
3 Produced at the Lawrence Livermore National Laboratory.
4 Written by Mark C. Miller
5 
6 LLNL-CODE-676051. All rights reserved.
7 
8 This file is part of MACSio
9 
10 Please also read the LICENSE file at the top of the source code directory or
11 folder hierarchy.
12 
13 This program is free software; you can redistribute it and/or modify it under
14 the terms of the GNU General Public License (as published by the Free Software
15 Foundation) version 2, dated June 1991.
16 
17 This program is distributed in the hope that it will be useful, but WITHOUT
18 ANY WARRANTY; without even the IMPLIED WARRANTY OF MERCHANTABILITY or FITNESS
19 FOR A PARTICULAR PURPOSE. See the terms and conditions of the GNU General
20 Public License for more details.
21 
22 You should have received a copy of the GNU General Public License along with
23 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
24 Place, Suite 330, Boston, MA 02111-1307 USA
25 */
26 
27 /* Simple test/proto code using silo directly to evolve basic things needed for parallel
28  synthesis of a parallel decomposed mesh */
29 #include <mpi.h>
30 #include <silo.h>
31 
32 #include <log.h>
33 #include <option.h>
34 #include <util.h>
35 
36 int main(int argc, char **argv)
37 {
38  const int unknownArgsFlag = IOP_WARN;
39  int cl_result;
40 
41  cl_result = IOPProcessCommandLine(unknownArgsFlag, 1, argc, argv,
42  "--2d-size %dx%d",
43  "Specify logic size of output mesh"
44  "to print a list of all known interfaces and then exit",
45  IOPGetMutableArrOption(opts, ISIZE),
46  IOPGetMutableArrOption(opts, JSIZE),
47  "--parallel-file-mode %s %d",
48  "Specify the parallel file mode. There are several choices. "
49  "Use 'MIF' for Multiple Independent File (Poor Man's) mode and then "
50  "also specify the number of files. Or, use 'MIFMAX' for MIF mode and "
51  "one file per processor or 'MIFAUTO' for MIF mode and let the test "
52  "determine the optimum file count. Use 'SIF' for SIngle shared File "
53  "(Rich Man's) mode.",
54  IOPGetMutableArrOption(opts, PARALLEL_FILE_MODE),
55  IOPGetMutableOption(opts, PARALLEL_FILE_COUNT),
56  "--request-size %d",
57  "Per-processor request size. A following B|K|M|G character indicates 'B'ytes (2^0), "
58  "'K'ilobytes (2^10), 'M'egabytes (2^20) or 'G'igabytes (2^30) [1M]",
59  IOPGetMutableOption(opts, REQUEST_SIZE),
60  "--num-requests %d",
61  "Total number of I/O requests [10]",
62  IOPGetMutableOption(opts, NUM_REQUESTS),
63  "--size-noise %d",
64  "Randomly insert tiny I/O requests of specified size between main "
65  "requests [0]",
66  IOPGetMutableOption(opts, SIZE_NOISE),
67  "--initial-size %d",
68  "Specify initial file size to start from [0]",
69  IOPGetMutableOption(opts, INIT_FILE_SIZE),
70  "--alignment %d",
71  "Align all I/O requests on boundaries that are a integral multiple "
72  "of this size",
73  IOPGetMutableOption(opts, ALIGNMENT),
74  "--filename %s",
75  "Specify sprintf-style string to indicate how file(s) should be named. If the "
76  "the file(s) already exists, they will be used in a read test. If the file(s) "
77  "do not exist, it/they will be generated in a write test. "
78  "Default is 'iop-<iface>-<group#>.<ext>' where <group#> is the group number "
79  "(MIF modes) or absent (SIF mode), <iface> is the name of the interface and <ext> "
80  "is the canonical file extension for the given interface.",
81  IOPGetMutableArrOption(opts, FILENAME_SPRINTF),
82  "--rand-file-name",
83  "Generate random filenames (why?)",
84  IOPGetMutableOption(opts, RAND_FILENAME),
85  "--no-mpi",
86  "Do not use MPI. Just write a file per processor using random file "
87  "names",
88  IOPGetMutableOption(opts, NO_MPI),
89  "--print-details",
90  "Print detailed I/O performance data",
91  IOPGetMutableOption(opts, PRINT_TIMING_DETAILS),
92  "--driver-args %n",
93  "All arguments after this sentinel are passed to the I/O driver plugin (ignore the %n)",
94  &plugin_args_start,
95  IOP_END_OF_ARGS);
96 
97  /* if we discovered help was requested, then print each plugin's help too */
98  if (cl_result == IOP_ARGV_HELP)
99  handle_help_request_and_exit(plugin_args_start+1, argc, argv);
100 
101  if (!strcmp(IOPGetStrOption(opts, IOINTERFACE_NAME), "list"))
103 
104  /* sanity check some values */
105  if (!IOPGetStrOption(opts, IOINTERFACE_NAME))
106  IOP_ERROR(("no io-interface specified"), IOP_FATAL);
107 
108  if (plugin_argi)
109  *plugin_argi = plugin_args_start>-1?plugin_args_start+1:argc;
110 
111 }
112 }
static void handle_help_request_and_exit(int argi, int argc, char **argv)
Definition: macsio_main.c:287
int main(int argc, char **argv)
Definition: make_par_mesh.c:36
static void handle_list_request_and_exit()
Definition: macsio_main.c:311