~james-page/ubuntu/precise/openmpi1.5/new

« back to all changes in this revision

Viewing changes to orte/mca/iof/base/iof_base_open.c

  • Committer: Bazaar Package Importer
  • Author(s): Manuel Prinz
  • Date: 2009-04-23 14:01:21 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20090423140121-vsi3pqa6g30j4qiy
Tags: 1.3.2-1
* New upstream release. (Closes: #520597, #515116)
  - Manpage and VampirTrace patches removed, included upstream.
* Fixed build issues on Alpha. Huge thanks to Arthur Loiret for providing
  access to his machines for testing! (Closes: #510845, #517543)
* Fixed build issues on Sparc. (Closes: #519725)
* Fixed manpage-has-errors-from-man lintian warnings.
* Faked SONAME change by renaming library package. (Closes: #512616)
* Made libopenmpi-dev depend on libibverbs-dev. (Closes: #522153)
* Support for "nocheck" build option in debian/rules.
* Updated Standards-Version in debian/control.
* Changed section of libopenmpi-dbg to "debug".
* Updated debian/copyright.

* Dirk Eddelbuettel removed himself from Uploaders. The team thanks Dirk
  for his long-term contribution and effort to get Open MPI back to life.
  I personally thank Dirk for encouraging me to become a Debian Developer
  and his support and mentoring on that way and beyond.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
#include "opal/mca/mca.h"
26
26
#include "opal/mca/base/base.h"
27
27
#include "opal/mca/base/mca_base_param.h"
 
28
#include "opal/util/os_dirpath.h"
 
29
#include "opal/util/basename.h"
28
30
 
29
31
#include "orte/util/show_help.h"
30
32
#include "orte/util/proc_info.h"
84
86
 
85
87
static void orte_iof_base_sink_construct(orte_iof_sink_t* ptr)
86
88
{
 
89
    ptr->daemon.jobid = ORTE_JOBID_INVALID;
 
90
    ptr->daemon.vpid = ORTE_VPID_INVALID;
87
91
    ptr->wev = OBJ_NEW(orte_iof_write_event_t);
88
92
}
89
93
static void orte_iof_base_sink_destruct(orte_iof_sink_t* ptr)
163
167
 */
164
168
int orte_iof_base_open(void)
165
169
{
 
170
    int rc;
 
171
    
166
172
    /* Initialize globals */
167
173
    OBJ_CONSTRUCT(&orte_iof_base.iof_components_opened, opal_list_t);
168
174
    OBJ_CONSTRUCT(&orte_iof_base.iof_write_output_lock, opal_mutex_t);
169
175
 
 
176
    /* did the user request we print output to files? */
 
177
    if (NULL != orte_output_filename) {
 
178
        /* we will setup the files themselves as needed in the iof
 
179
         * module. For now, let's see if the filename contains a
 
180
         * path, or just a name
 
181
         */
 
182
        char *path;
 
183
        path = opal_dirname(orte_output_filename);
 
184
        if (0 != strcmp(path, orte_output_filename)) {
 
185
            /* there is a path in this name - ensure that the directory
 
186
             * exists, and create it if not
 
187
             */
 
188
            if (ORTE_SUCCESS != (rc = opal_os_dirpath_create(path, S_IRWXU))) {
 
189
                return rc;
 
190
            }
 
191
        }
 
192
    }
 
193
    
170
194
    /* daemons do not need to do this as they do not write out stdout/err */
171
195
    if (!orte_process_info.daemon) {
172
196
        /* setup the stdout event */
173
 
        OBJ_CONSTRUCT(&orte_iof_base.iof_write_stdout, orte_iof_write_event_t);
174
 
        orte_iof_base.iof_write_stdout.fd = 1;
175
 
        /* create the write event, but don't add it until we need it */
176
 
        opal_event_set(&orte_iof_base.iof_write_stdout.ev,
177
 
                       orte_iof_base.iof_write_stdout.fd,
178
 
                       OPAL_EV_WRITE,
179
 
                       orte_iof_base_write_handler,
180
 
                       &orte_iof_base.iof_write_stdout);
181
 
        
 
197
        ORTE_IOF_SINK_DEFINE(&orte_iof_base.iof_write_stdout, ORTE_PROC_MY_NAME,
 
198
                             1, ORTE_IOF_STDOUT, orte_iof_base_write_handler, NULL);        
182
199
        /* setup the stderr event */
183
 
        OBJ_CONSTRUCT(&orte_iof_base.iof_write_stderr, orte_iof_write_event_t);
184
 
        orte_iof_base.iof_write_stderr.fd = 2;
185
 
        /* create the write event, but don't add it until we need it */
186
 
        opal_event_set(&orte_iof_base.iof_write_stderr.ev,
187
 
                       orte_iof_base.iof_write_stderr.fd,
188
 
                       OPAL_EV_WRITE,
189
 
                       orte_iof_base_write_handler,
190
 
                       &orte_iof_base.iof_write_stderr);
 
200
        ORTE_IOF_SINK_DEFINE(&orte_iof_base.iof_write_stderr, ORTE_PROC_MY_NAME,
 
201
                             2, ORTE_IOF_STDERR, orte_iof_base_write_handler, NULL);        
191
202
        /* do NOT set these file descriptors to non-blocking. If we do so,
192
203
         * we set the file descriptor to non-blocking for everyone that has
193
204
         * that file descriptor, which includes everyone else in our shell