extern int bcast_file(struct bcast_parameters *params) { int rc; if ((rc = _file_state(params)) != SLURM_SUCCESS) return rc; if ((rc = _get_job_info(params)) != SLURM_SUCCESS) return rc; if ((rc = _bcast_file(params)) != SLURM_SUCCESS) return rc; /* slurm_free_sbcast_cred_msg(sbcast_cred); */ return rc; }
int main(int argc, char *argv[]) { log_options_t opts = LOG_OPTS_STDERR_ONLY; log_init("sbcast", opts, SYSLOG_FACILITY_DAEMON, NULL); #ifdef HAVE_ALPS_CRAY error("The sbcast command is not supported on Cray systems"); return 1; #endif #ifdef HAVE_BG error("The sbcast command is not supported on IBM BlueGene systems"); return 1; #endif slurm_conf_init(NULL); parse_command_line(argc, argv); if (params.verbose) { opts.stderr_level += params.verbose; log_alter(opts, SYSLOG_FACILITY_DAEMON, NULL); } /* validate the source file */ if ((fd = open(params.src_fname, O_RDONLY)) < 0) { error("Can't open `%s`: %s", params.src_fname, strerror(errno)); exit(1); } if (fstat(fd, &f_stat)) { error("Can't stat `%s`: %s", params.src_fname, strerror(errno)); exit(1); } verbose("modes = %o", (unsigned int) f_stat.st_mode); verbose("uid = %d", (int) f_stat.st_uid); verbose("gid = %d", (int) f_stat.st_gid); verbose("atime = %s", slurm_ctime(&f_stat.st_atime)); verbose("mtime = %s", slurm_ctime(&f_stat.st_mtime)); verbose("ctime = %s", slurm_ctime(&f_stat.st_ctime)); verbose("size = %ld", (long) f_stat.st_size); verbose("-----------------------------"); /* identify the nodes allocated to the job */ _get_job_info(); /* transmit the file */ _bcast_file(); /* slurm_free_sbcast_cred_msg(sbcast_cred); */ exit(0); }