diff --git a/src/srun/io.c b/src/srun/io.c index 3544534fe2fecf2b4001ab7a2bd11e580d9b81dd..5f7aa0b90b30d594674093f9d45c868b52c33000 100644 --- a/src/srun/io.c +++ b/src/srun/io.c @@ -404,7 +404,7 @@ _accept_io_stream(job_t *job, int i) int len = size_io_stream_header(); int j; int fd = job->iofd[i]; - verbose("Activity on IO server port %d fd %d", i, fd); + debug("Activity on IO server port %d fd %d", i, fd); for (j = 0; j < 15; i++) { int sd, size_read; @@ -470,7 +470,7 @@ _accept_io_stream(job_t *job, int i) else job->err[hdr.task_id] = sd; - verbose("accepted %s connection from %s task %ld, sd=%d", + debug("accepted %s connection from %s task %ld, sd=%d", (hdr.type ? "stderr" : "stdout"), buf, hdr.task_id, sd ); } diff --git a/src/srun/launch.c b/src/srun/launch.c index 986864430e322ac35a947f6c7da8ca9c0d6eb79e..2bd9df7f4d082f18698f802d69f483b8fff9a522 100644 --- a/src/srun/launch.c +++ b/src/srun/launch.c @@ -66,7 +66,8 @@ static void _dist_block(job_t *job, uint32_t **task_ids); static void _dist_cyclic(job_t *job, uint32_t **task_ids); static void _p_launch(slurm_msg_t *req_array_ptr, job_t *job); static void * _p_launch_task(void *args); -static void _print_launch_msg(launch_tasks_request_msg_t *msg); +static void _print_launch_msg(launch_tasks_request_msg_t *msg, + char * hostname); static int _envcount(char **env); static void @@ -261,8 +262,8 @@ static void * _p_launch_task(void *args) int host_inx = msg_ptr->srun_node_id; int failure = 0; - debug3("launching on host %s", job_ptr->host[host_inx]); - _print_launch_msg(msg_ptr); + if (_verbose || _debug) + _print_launch_msg(msg_ptr, job_ptr->host[host_inx]); if (slurm_send_only_node_msg(req_ptr) < 0) { /* Has timeout */ error("task launch error on %s: %m", job_ptr->host[host_inx]); pthread_mutex_lock(&job_ptr->task_mutex); @@ -288,13 +289,35 @@ static void * _p_launch_task(void *args) } -static void _print_launch_msg(launch_tasks_request_msg_t *msg) +static void +_print_launch_msg(launch_tasks_request_msg_t *msg, char * hostname) { - debug3("%d.%d uid:%ld n:%ld cwd:%s %d [%d-%d]", - msg->job_id, msg->job_step_id, (long) msg->uid, - (long) msg->tasks_to_launch, msg->cwd, - msg->srun_node_id, msg->global_task_ids[0], - msg->global_task_ids[msg->tasks_to_launch-1]); + int i; + char tmp_str[10], task_list[4096]; + + if (opt.distribution == SRUN_DIST_BLOCK) { + sprintf(task_list, "%u-%u", + msg->global_task_ids[0], + msg->global_task_ids[(msg->tasks_to_launch-1)]); + } else { + for (i=0; i<msg->tasks_to_launch; i++) { + sprintf(tmp_str, ",%u", msg->global_task_ids[i]); + if (i == 0) + strcpy(task_list, &tmp_str[1]); + else if ((strlen(tmp_str) + strlen(task_list)) < + sizeof(task_list)) + strcat(task_list, tmp_str); + else + break; + } + } + + printf("launching %u.%u on host %s, %u tasks: %s\n", + msg->job_id, msg->job_step_id, hostname, + msg->tasks_to_launch, task_list); + + debug3("uid:%ld cwd:%s %d", + (long) msg->uid, msg->cwd, msg->srun_node_id); } static int diff --git a/src/srun/srun.c b/src/srun/srun.c index 226ad006ce490eb9d203f7a88aafb37101bfb5a7..c484220c8e2ec75e8167226ff23d2e1f4c6d630e 100644 --- a/src/srun/srun.c +++ b/src/srun/srun.c @@ -175,18 +175,17 @@ main(int ac, char **av) if ( !(resp = _allocate_nodes()) ) exit(1); job = job_create(resp); - if (_verbose || _debug) + if (_debug) _print_job_information(resp); _run_job_script(resp->job_id); slurm_complete_job(resp->job_id, 0, 0); - if (_verbose || _debug) - info ("Spawned srun shell terminated"); + debug ("Spawned srun shell terminated"); exit (0); } else { if ( !(resp = _allocate_nodes()) ) exit(1); - if (_verbose || _debug) + if (_debug) _print_job_information(resp); job = job_create(resp);