~ubuntu-branches/ubuntu/vivid/slurm-llnl/vivid

« back to all changes in this revision

Viewing changes to src/slurmd/slurmstepd/slurmstepd.c

  • Committer: Bazaar Package Importer
  • Author(s): Gennaro Oliva
  • Date: 2009-09-24 23:28:15 UTC
  • mfrom: (1.1.11 upstream) (3.2.4 sid)
  • Revision ID: james.westby@ubuntu.com-20090924232815-enh65jn32q1ebg07
Tags: 2.0.5-1
* New upstream release 
* Changed dependecy from lib-mysqlclient15 to lib-mysqlclient 
* Added Default-Start for runlevel 2 and 4 and $remote_fs requirement in
  init.d scripts (Closes: #541252)
* Postinst checks for wrong runlevels 2 and 4 links
* Upgraded to standard version 3.8.3
* Add lintian overrides for missing slurm-llnl-configurator.html in doc
  base registration
* modified postrm scripts to ignore pkill return value in order to avoid
  postrm failure when no slurm process is running
* Checking for slurmctld.pid before cancelling running and pending
  jobs during package removal 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*****************************************************************************\
2
2
 *  src/slurmd/slurmstepd/slurmstepd.c - SLURM job-step manager.
3
 
 *  $Id: slurmstepd.c 17040 2009-03-26 15:03:18Z jette $
 
3
 *  $Id: slurmstepd.c 17056 2009-03-26 23:35:52Z dbremer $
4
4
 *****************************************************************************
5
 
 *  Copyright (C) 2002-2006 The Regents of the University of California.
 
5
 *  Copyright (C) 2002-2007 The Regents of the University of California.
 
6
 *  Copyright (C) 2008-2009 Lawrence Livermore National Security.
6
7
 *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
7
8
 *  Written by Danny Auble <da@llnl.gov> 
8
9
 *  and Christopher Morrone <morrone2@llnl.gov>.
9
 
 *  LLNL-CODE-402394.
 
10
 *  CODE-OCEC-09-009. All rights reserved.
10
11
 *  
11
12
 *  This file is part of SLURM, a resource management program.
12
 
 *  For details, see <http://www.llnl.gov/linux/slurm/>.
 
13
 *  For details, see <https://computing.llnl.gov/linux/slurm/>.
 
14
 *  Please also read the included file: DISCLAIMER.
13
15
 *  
14
16
 *  SLURM is free software; you can redistribute it and/or modify it under
15
17
 *  the terms of the GNU General Public License as published by the Free
98
100
                _dump_user_env();
99
101
                exit(0);
100
102
        }
101
 
 
102
103
        xsignal_block(slurmstepd_blocked_signals);
103
104
        conf = xmalloc(sizeof(*conf));
104
105
        conf->argv = &argv;
105
106
        conf->argc = &argc;
106
107
        init_setproctitle(argc, argv);
 
108
 
 
109
        /* Receive job parameters from the slurmd */
107
110
        _init_from_slurmd(STDIN_FILENO, argv, &cli, &self, &msg,
108
111
                          &ngids, &gids);
109
112
 
112
115
         * on STDERR_FILENO for us. */
113
116
        dup2(STDERR_FILENO, STDIN_FILENO);
114
117
 
 
118
        /* Create the slurmd_job_t, mostly from info in a 
 
119
           launch_tasks_request_msg_t or a batch_job_launch_msg_t */
115
120
        job = _step_setup(cli, self, msg);
116
121
        job->ngids = ngids;
117
122
        job->gids = gids;
118
123
 
 
124
        /* fork handlers cause mutexes on some global data structures 
 
125
           to be re-initialized after the fork. */
119
126
        list_install_fork_handlers();
120
127
        slurm_conf_install_fork_handlers();
 
128
 
121
129
        /* sets job->msg_handle and job->msgid */
122
130
        if (msg_thr_create(job) == SLURM_ERROR) {
123
131
                _send_fail_to_slurmd(STDOUT_FILENO);
132
140
         * on STDERR_FILENO for us. */
133
141
        dup2(STDERR_FILENO, STDOUT_FILENO);
134
142
 
135
 
        rc = job_manager(job); /* blocks until step is complete */
 
143
        /* This does most of the stdio setup, then launches all the tasks,
 
144
           and blocks until the step is complete */
 
145
        rc = job_manager(job); 
136
146
 
137
147
        /* signal the message thread to shutdown, and wait for it */
138
148
        eio_signal_shutdown(job->msg_handle);