예제 #1
0
파일: backup.c 프로젝트: bingzhang/slurm
/*
 * Reload the slurm.conf parameters without any processing
 * of the node, partition, or state information.
 * Specifically, we don't want to purge batch scripts based
 * upon old job state information.
 * This is a stripped down version of read_slurm_conf(0).
 */
static void _backup_reconfig(void)
{
	slurm_conf_reinit(NULL);
	update_logging();
	slurmctld_conf.last_update = time(NULL);
	return;
}
예제 #2
0
파일: backup.c 프로젝트: VURM/slurm
/*
 * Reload the slurm.conf parameters without any processing
 * of the node, partition, or state information.
 * Specifically, we don't want to purge batch scripts based
 * upon old job state information.
 * This is a stripped down version of read_slurm_conf(0).
 */
static int _backup_reconfig(void)
{
	slurm_conf_reinit(NULL);
	update_logging();
	slurmctld_conf.last_update = time(NULL);
	return SLURM_SUCCESS;
}
예제 #3
0
void _initialize(char* argv[])
{
	slurm_conf_reinit(argv[1]); //load the slurm configuration file
	self_id = strdup(slurmctld_conf.control_machine); //get the controller id

	num_ctrl = str_to_int(argv[2]); // get the number of controllers
	mem_list = c_calloc_2(num_ctrl, 30);

	_read_memlist(argv[3]); // read the controller membership list

	part_size = str_to_int(argv[4]); //get the partition size
	source = c_calloc_2(part_size + 1, 30);

	/* fill the node list of the controller (part_size, node_1, node_2, ...) */
	resource = c_calloc((part_size + 1) * 30);
	strcat(resource, argv[4]); strcat(resource, ",");

	/* read workload and fill it in the job queue*/
	job_queue = init_queue();
	_read_workload(argv[5]);
	num_job = job_queue->queue_length;

	c_zht_init(argv[6], argv[7]); // initialize the controller as a ZHT client

	max_proc_thread = str_to_int(argv[8]);

	char *job_output_path = c_calloc(100);
	strcpy(job_output_path, "./job_output_");
	strcat(job_output_path, argv[9]);
	job_output_file = fopen(job_output_path, "w");
	c_free(job_output_path);
}
예제 #4
0
파일: slurmd.c 프로젝트: mrhaoji/slurm
static void
_reconfigure(void)
{
	List steps;
	ListIterator i;
	slurm_ctl_conf_t *cf;
	step_loc_t *stepd;
	bool did_change;

	_reconfig = 0;
	slurm_conf_reinit(conf->conffile);
	_read_config();

	/*
	 * Rebuild topology information and refresh slurmd topo infos
	 */
	slurm_topo_build_config();
	_set_topo_info();

	/*
	 * In case the administrator changed the cpu frequency set capabilities
	 * on this node, rebuild the cpu frequency table information
	 */
	cpu_freq_init(conf);

	_print_conf();

	/*
	 * Make best effort at changing to new public key
	 */
	slurm_cred_ctx_key_update(conf->vctx, conf->pubkey);

	/*
	 * Reinitialize the groups cache
	 */
	cf = slurm_conf_lock();
	if (cf->group_info & GROUP_CACHE)
		init_gids_cache(1);
	else
		init_gids_cache(0);
	slurm_conf_unlock();

	/* send reconfig to each stepd so they can refresh their log
	 * file handle
	 */

	steps = stepd_available(conf->spooldir, conf->node_name);
	i = list_iterator_create(steps);
	while ((stepd = list_next(i))) {
		int fd;
		fd = stepd_connect(stepd->directory, stepd->nodename,
				   stepd->jobid, stepd->stepid);
		if (fd == -1)
			continue;
		if (stepd_reconfig(fd) != SLURM_SUCCESS)
			debug("Reconfig jobid=%u.%u failed: %m",
			      stepd->jobid, stepd->stepid);
		close(fd);
	}
	list_iterator_destroy(i);
	list_destroy(steps);

	gres_plugin_reconfig(&did_change);
	(void) switch_g_reconfig();
	container_g_reconfig();
	if (did_change) {
		uint32_t cpu_cnt = MAX(conf->conf_cpus, conf->block_map_size);
		(void) gres_plugin_node_config_load(cpu_cnt);
		send_registration_msg(SLURM_SUCCESS, false);
	}

	/* reconfigure energy */
	acct_gather_energy_g_set_data(ENERGY_DATA_RECONFIG, NULL);

	/*
	 * XXX: reopen slurmd port?
	 */
}
예제 #5
0
파일: wire_test.c 프로젝트: BYUHPC/slurm
int main(int argc, char** argv)
{
	select_ba_request_t *request = xmalloc(sizeof(select_ba_request_t));
	log_options_t log_opts = LOG_OPTS_INITIALIZER;
	int debug_level = 5;

	List results;
//	List results2;
//	int i,j;
	log_opts.stderr_level  = debug_level;
	log_opts.logfile_level = debug_level;
	log_opts.syslog_level  = debug_level;

	log_alter(log_opts, LOG_DAEMON, "/dev/null");

	DIM_SIZE[X]=0;
	DIM_SIZE[Y]=0;
	DIM_SIZE[Z]=0;

	slurm_conf_reinit(NULL);
	ba_init(NULL, 1);

	/* [010x831] */
/* 	results = list_create(NULL); */
/* 	request->geometry[0] = 9; */
/* 	request->geometry[1] = 3; */
/* 	request->geometry[2] = 2; */
/* 	request->start[0] = 0; */
/* 	request->start[1] = 1; */
/* 	request->start[2] = 0; */
/* 	request->start_req = 1; */
/* //	request->size = 16; */
/* 	request->rotate = 0; */
/* 	request->elongate = 0; */
/* 	request->conn_type = SELECT_TORUS; */
/* 	new_ba_request(request); */
/* 	print_ba_request(request); */
/* 	if (!allocate_block(request, results)) { */
/*        		debug("couldn't allocate %c%c%c", */
/* 		       alpha_num[request->geometry[0]], */
/* 		       alpha_num[request->geometry[1]], */
/* 		       alpha_num[request->geometry[2]]); */
/* 	} */
/* 	list_destroy(results); */

/* 	/\* [001x801] *\/ */
/* 	results = list_create(NULL); */
/* 	request->geometry[0] = 9; */
/* 	request->geometry[1] = 1; */
/* 	request->geometry[2] = 1; */
/* 	request->start[0] = 0; */
/* 	request->start[1] = 0; */
/* 	request->start[2] = 1; */
/* 	request->start_req = 1; */
/* //	request->size = 1; */
/* 	request->rotate = 0; */
/* 	request->elongate = 0; */
/* 	request->conn_type = SELECT_TORUS; */
/* 	new_ba_request(request); */
/* 	print_ba_request(request); */
/* 	if (!allocate_block(request, results)) { */
/*        		debug("couldn't allocate %c%c%c", */
/* 		       request->geometry[0], */
/* 		       request->geometry[1], */
/* 		       request->geometry[2]); */
/* 	} */
/* 	list_destroy(results); */

	/* [001x801] */
	results = list_create(NULL);
	request->geometry[0] = 7;
	request->geometry[1] = 4;
	request->geometry[2] = 2;
	request->start[0] = 0;
	request->start[1] = 0;
	request->start[2] = 0;
	request->start_req = 0;
//	request->size = 1;
	request->rotate = 1;
	request->elongate = 1;
	request->conn_type[0] = SELECT_TORUS;
	new_ba_request(request);
	print_ba_request(request);
	if (!allocate_block(request, results)) {
       		debug("couldn't allocate %c%c%c",
		       request->geometry[0],
		       request->geometry[1],
		       request->geometry[2]);
	}
	list_destroy(results);


	int dim,j;
	int x,y,z;
	int startx=0;
	int starty=0;
	int startz=0;
	int endx=DIM_SIZE[X];
	int endy=1;//DIM_SIZE[Y];
	int endz=1;//DIM_SIZE[Z];

	for(x=startx;x<endx;x++) {
		for(y=starty;y<endy;y++) {
			for(z=startz;z<endz;z++) {
				ba_mp_t *curr_node = &(ba_main_grid[x][y][z]);
				info("Node %c%c%c Used = %d",
				     alpha_num[x],alpha_num[y],alpha_num[z],
				     curr_node->used);
				for(dim=0;dim<1;dim++) {
					info("Dim %d",dim);
					ba_switch_t *wire =
						&curr_node->axis_switch[dim];
					for(j=0;j<NUM_PORTS_PER_NODE;j++)
						info("\t%d -> %d -> %c%c%c %d "
						     "Used = %d",
						     j, wire->int_wire[j].
						     port_tar,
						     alpha_num[wire->ext_wire[
							     wire->int_wire[j].
							     port_tar].
							       mp_tar[X]],
						     alpha_num[wire->ext_wire[
							     wire->int_wire[j].
							     port_tar].
						     mp_tar[Y]],
						     alpha_num[wire->ext_wire[
							     wire->int_wire[j].
							     port_tar].
						     mp_tar[Z]],
						     wire->ext_wire[
							     wire->int_wire[j].
							     port_tar].
						     port_tar,
						     wire->int_wire[j].used);
				}
			}
		}
	}
	/* list_destroy(results); */

/* 	ba_fini(); */

/* 	delete_ba_request(request); */

	return 0;
}