static void _handle_multi_prog(char *in_file, int *command_pos, opt_t *opt_local) { char in_line[512]; FILE *fp; int count = 0; if (verify_multi_name(in_file, &opt_local->ntasks, &opt_local->ntasks_set, &opt_local->multi_prog_cmds)) exit(error_exit); fp = fopen(in_file, "r"); if (!fp) { fatal("fopen(%s): %m", in_file); return; } while (fgets(in_line, sizeof(in_line), fp)) { if (_parse_prog_line(in_line, command_pos, count, opt_local)) count++; } return; }
extern int launch_p_handle_multi_prog_verify(int command_pos) { if (opt.multi_prog) { if (opt.argc < 1) { error("configuration file not specified"); exit(error_exit); } _load_multi(&opt.argc, opt.argv); if (verify_multi_name(opt.argv[command_pos], opt.ntasks)) exit(error_exit); return 1; } else return 0; }