13 #include <FrontISTRConfig.h>
37 MPI_Comm_size(MPI_COMM_WORLD, &proc);
45 int name_length = 256;
46 char name[name_length];
50 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
51 MPI_Comm_size(MPI_COMM_WORLD, &proc);
52 MPI_Get_processor_name(name, &name_length);
54 printf(
" %d: %s\n",0,name);
56 ret = MPI_Recv(&name, name_length, MPI_CHAR, i, 0, MPI_COMM_WORLD, &status);
57 printf(
" %d: %s\n",i,name);
60 ret = MPI_Send(&name, name_length, MPI_CHAR, 0, 0, MPI_COMM_WORLD);
63 gethostname(name, name_length);
64 printf(
" %d: %s\n",0,name);
69 return omp_get_max_threads();
79 void set_num_threads(
char *arg) {
83 fprintf(stderr,
"Error : specify number of OpenMP threads.\n");
84 fprintf(stderr,
"Format: -t <n>\n");
88 exec_threads = atoi(arg);
90 if (exec_threads == 0) {
91 fprintf(stderr,
"Error : specify 1 or more OpenMP threads.\n");
94 omp_set_num_threads(exec_threads);
102 printf(
"usage: [ mpirun -np <mpiprocs> ] fistr1 [options] \n");
103 printf(
" -h: Show this help message.\n");
104 printf(
" -v: Show version.\n");
106 printf(
" -t <n>: Set number of OpenMP threads\n");
108 printf(
" -c <Path of control file>: Use this control file. Default "
109 "./hecmw_ctrl.dat\n");
110 printf(
"--debug: Show debug messages.\n");
119 printf(
"MPI: Enabled\n");
121 printf(
"MPI: Disabled\n");
123 #ifndef OPENMP_UNKNOWN
125 printf(
"OpenMP: Enabled\n");
127 printf(
"OpenMP: Disabled\n");
130 printf(
"OpenMP: Unknown\n");
132 #ifdef HECMW_METIS_VER
133 printf(
"HECMW_METIS_VER: %d\n", HECMW_METIS_VER);
135 printf(
"CompileOption: ");
140 printf(
"--with-tools ");
143 printf(
"--with-refiner ");
146 printf(
"--with-metis ");
149 printf(
"--with-mumps ");
152 printf(
"--with-lapack ");
155 printf(
"--with-ml ");
158 printf(
"--with-parmetis ");
161 printf(
"--with-mkl ");
171 fprintf(stderr,
"Sorry this option cannot work yet. (-c)\n");
172 fprintf(stderr,
"%s\n", arg);
193 {
"-t", set_num_threads},
194 {
"-T", set_num_threads},
205 int main(
int argc,
char *argv[])
211 time_t t = time(
NULL);
214 MPI_Init(&argc, &argv);
215 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
218 printf(
"##################################################################\n");
219 printf(
"# FrontISTR #\n");
220 printf(
"##################################################################\n");
222 if (VERSION_PATCH == 0){
223 printf(
"version: %d.%d\n", VERSION_MAJOR,VERSION_MINOR);
225 printf(
"version: %d.%d.%d\n", VERSION_MAJOR,VERSION_MINOR, VERSION_PATCH);
227 printf(
"git_hash: %s\n", GIT_HASH );
229 printf(
" date: %s\n", BUILD_DATE );
234 printf(
"disabled\n");
237 #ifndef OPENMP_UNKNOWN
241 printf(
"disabled\n");
252 printf(
"--with-tools ");
255 printf(
"--with-refiner ");
258 printf(
"--with-metis ");
261 printf(
"--with-mumps ");
264 printf(
"--with-lapack ");
267 printf(
"--with-ml ");
270 printf(
"--with-parmetis ");
273 printf(
"--with-mkl ");
277 #ifdef HECMW_METIS_VER
278 printf(
" HECMW_METIS_VER: %d\n", HECMW_METIS_VER);
282 for (i = 0; i < argc; i++) {
285 p->
func(argv[i + 1]);
290 printf(
"execute: \n");
291 strftime(date,
sizeof(date),
"%Y-%m-%dT%H:%M:%S%z", localtime(&t));
292 printf(
" date: %s\n", date);
304 MPI_Barrier( MPI_COMM_WORLD );
void HECMW_setloglv(int loglv)
int main(int argc, char *argv[])
main function
void help(char *arg)
show available command line option
void set_loglevel_debug(char *arg)
set log level to HECMW_LOG_DEBUG
void fstr_main()
Startup routine for FrontISTR.
void version(char *arg)
show version and revision of FrontISTR
struct option_rec options[]
specify command line option name and executing function name. \attension list must be terminated with...
void load_hecmw_ctrl(char *arg)
load hecmw_ctrl.dat from specified place
struct of command-line option