1
1
openmpi/ompi/mca/sharedfp/lockedfile/sharedfp_lockedfile_get_position.c
Brian Barrett d984d25da3 Remove orte header file from sharedfp components (OMPI layer should not
include ORTE layer with the RTE framework).  Thankfully, nothing used
orte_show_help, so easy fix.

This commit was SVN r28884.
2013-07-20 22:03:44 +00:00

62 строки
2.2 KiB
C

/*
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2005 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2008 University of Houston. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include "sharedfp_lockedfile.h"
#include "mpi.h"
#include "ompi/constants.h"
#include "ompi/mca/sharedfp/sharedfp.h"
int
mca_sharedfp_lockedfile_get_position(mca_io_ompio_file_t *fh,
OMPI_MPI_OFFSET_TYPE * offset)
{
int ret = OMPI_SUCCESS;
mca_sharedfp_base_module_t * shared_fp_base_module;
struct mca_sharedfp_base_data_t *sh = NULL;
opal_output(1,"sharedfp_lockedfile_get_position\n");
if(fh->f_sharedfp_data==NULL){
opal_output(1,"sharedfp_lockedfile_get_position - opening the shared file pointer\n");
shared_fp_base_module = fh->f_sharedfp;
ret = shared_fp_base_module->sharedfp_file_open(fh->f_comm,
fh->f_filename,
fh->f_amode,
fh->f_info,
fh);
if (ret != OMPI_SUCCESS) {
opal_output(1,"sharedfp_lockedfile_write - error opening the shared file pointer\n");
return ret;
}
}
/*Retrieve the shared file data struct*/
sh = fh->f_sharedfp_data;
/*Requesting the offset to write 0 bytes,
*returns the current offset w/o updating it
*/
ret = mca_sharedfp_lockedfile_request_position(sh,0,offset);
return ret;
}