root/ompi/mca/sharedfp/individual/sharedfp_individual.h

/* [<][>][^][v][top][bottom][index][help] */

INCLUDED FROM


   1 /*
   2  * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
   3  *                         University Research and Technology
   4  *                         Corporation.  All rights reserved.
   5  * Copyright (c) 2004-2006 The University of Tennessee and The University
   6  *                         of Tennessee Research Foundation.  All rights
   7  *                         reserved.
   8  * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
   9  *                         University of Stuttgart.  All rights reserved.
  10  * Copyright (c) 2004-2005 The Regents of the University of California.
  11  *                         All rights reserved.
  12  * Copyright (c) 2013-2016 University of Houston. All rights reserved.
  13  * Copyright (c) 2015-2018 Research Organization for Information Science
  14  *                         and Technology (RIST). All rights reserved.
  15  * Copyright (c) 2016-2017 IBM Corporation. All rights reserved.
  16  * $COPYRIGHT$
  17  *
  18  * Additional copyrights may follow
  19  *
  20  * $HEADER$
  21  */
  22 
  23 #ifndef MCA_SHAREDFP_INDIVIDUAL_H
  24 #define MCA_SHAREDFP_INDIVIDUAL_H
  25 
  26 #include "ompi_config.h"
  27 #include "ompi/mca/mca.h"
  28 #include "ompi/mca/sharedfp/sharedfp.h"
  29 #include "ompi/mca/common/ompio/common_ompio.h"
  30 
  31 
  32 BEGIN_C_DECLS
  33 
  34 int mca_sharedfp_individual_component_init_query(bool enable_progress_threads,
  35                                                  bool enable_mpi_threads);
  36 struct mca_sharedfp_base_module_1_0_0_t *
  37         mca_sharedfp_individual_component_file_query (ompio_file_t *file, int *priority);
  38 int mca_sharedfp_individual_component_file_unquery (ompio_file_t *file);
  39 
  40 int mca_sharedfp_individual_module_init (ompio_file_t *file);
  41 int mca_sharedfp_individual_module_finalize (ompio_file_t *file);
  42 
  43 extern int mca_sharedfp_individual_priority;
  44 extern int mca_sharedfp_individual_verbose;
  45 extern int mca_sharedfp_individual_usage_counter;
  46 
  47 OMPI_MODULE_DECLSPEC extern mca_sharedfp_base_component_2_0_0_t mca_sharedfp_individual_component;
  48 /*
  49  * ******************************************************************
  50  * ********* functions which are implemented in this module *********
  51  * ******************************************************************
  52  */
  53 /*IMPORANT: Update here when implementing functions from sharedfp API*/
  54 
  55 int mca_sharedfp_individual_get_position(ompio_file_t *fh,
  56                                          OMPI_MPI_OFFSET_TYPE * offset);
  57 int mca_sharedfp_individual_seek (ompio_file_t *fh,
  58                                   OMPI_MPI_OFFSET_TYPE offset, int whence);
  59 int mca_sharedfp_individual_file_open (struct ompi_communicator_t *comm,
  60                                        const char* filename,
  61                                        int amode,
  62                                        struct opal_info_t *info,
  63                                        ompio_file_t *fh);
  64 int mca_sharedfp_individual_file_close (ompio_file_t *fh);
  65 int mca_sharedfp_individual_read (ompio_file_t *fh,
  66                                   void *buf, int count, MPI_Datatype datatype, MPI_Status *status);
  67 int mca_sharedfp_individual_read_ordered (ompio_file_t *fh,
  68                                           void *buf, int count, struct ompi_datatype_t *datatype,
  69                                           ompi_status_public_t *status);
  70 int mca_sharedfp_individual_read_ordered_begin (ompio_file_t *fh,
  71                                                  void *buf,
  72                                                  int count,
  73                                                  struct ompi_datatype_t *datatype);
  74 int mca_sharedfp_individual_read_ordered_end (ompio_file_t *fh,
  75                                                void *buf,
  76                                                ompi_status_public_t *status);
  77 int mca_sharedfp_individual_iread (ompio_file_t *fh,
  78                                     void *buf,
  79                                     int count,
  80                                     struct ompi_datatype_t *datatype,
  81                                     ompi_request_t **request);
  82 int mca_sharedfp_individual_write (ompio_file_t *fh,
  83                                    const void *buf,
  84                                    int count,
  85                                    struct ompi_datatype_t *datatype,
  86                                    ompi_status_public_t *status);
  87 int mca_sharedfp_individual_write_ordered (ompio_file_t *fh,
  88                                            const void *buf,
  89                                            int count,
  90                                            struct ompi_datatype_t *datatype,
  91                                            ompi_status_public_t *status);
  92 int mca_sharedfp_individual_write_ordered_begin (ompio_file_t *fh,
  93                                                  const void *buf,
  94                                                  int count,
  95                                                  struct ompi_datatype_t *datatype);
  96 int mca_sharedfp_individual_write_ordered_end (ompio_file_t *fh,
  97                                                const void *buf,
  98                                                ompi_status_public_t *status);
  99 int mca_sharedfp_individual_iwrite (ompio_file_t *fh,
 100                                     const void *buf,
 101                                     int count,
 102                                     struct ompi_datatype_t *datatype,
 103                                     ompi_request_t **request);
 104 
 105 #define OMPI_FILE_WRITE_SHARED  3
 106 #define MAX_METADATA_RECORDS 1024
 107 
 108 typedef struct mca_sharedfp_individual_metadata_node_s {
 109     long recordid;                                      /* Denotes the type of function*/
 110     double timestamp;                                   /* Timestamp*/
 111     MPI_Offset localposition;                           /* Offset of the data in the central data file*/
 112     long recordlength;                                  /* Number of bytes*/
 113     struct mca_sharedfp_individual_metadata_node_s* next;
 114 } mca_sharedfp_individual_metadata_node;
 115 
 116 struct mca_sharedfp_individual_record2 {
 117     long recordid;                                          /* Denotes the type of function */
 118     double timestamp;                                       /* Timestamp */
 119     MPI_Offset localposition;                               /* Offset of the data in the central data file */
 120     long recordlength;                                      /* Number of bytes*/
 121 };
 122 
 123 /*This structure will hang off of the mca_sharedfp_base_data_t's
 124  *selected_module_data attribute
 125  */
 126 typedef struct mca_sharedfp_individual_header_record_s{
 127     int numofrecords;                                   /* Number of records in the linked list*/
 128     int numofrecordsonfile;                             /* Number of records in the metadatafile*/
 129     MPI_Offset datafile_offset;
 130     MPI_Offset metadatafile_offset;
 131     ompio_file_t * datafilehandle;
 132     ompio_file_t * metadatafilehandle;
 133     char * datafilename;                /*for now need to delete this on file close*/
 134     char * metadatafilename;            /*for now need to delete this on file close*/
 135     MPI_Offset metafile_start_offset;
 136     MPI_Offset datafile_start_offset;
 137     struct mca_sharedfp_individual_metadata_node_s *next;
 138 } mca_sharedfp_individual_header_record;
 139 
 140 
 141 mca_sharedfp_individual_header_record* mca_sharedfp_individual_insert_headnode(void);
 142 
 143 int mca_sharedfp_individual_collaborate_data(struct mca_sharedfp_base_data_t *sh, ompio_file_t *ompio_fh );
 144 int mca_sharedfp_individual_get_timestamps_and_reclengths(double **buff, long **rec_length, MPI_Offset **offbuff,struct mca_sharedfp_base_data_t *sh);
 145 int mca_sharedfp_individual_create_buff(double **ts,MPI_Offset **off,int totalnodes,int size);
 146 int mca_sharedfp_individual_sort_timestamps(double **ts,MPI_Offset **off, int **ranks, int totalnodes);
 147 MPI_Offset  mca_sharedfp_individual_assign_globaloffset(MPI_Offset **offsetbuff,int totalnodes,struct mca_sharedfp_base_data_t *sh);
 148 int mca_sharedfp_individual_getoffset(double timestamp, double *ts, int *ranks, int myrank, int totalnodes);
 149 /*int mca_sharedfp_individual_cleanup(double *ts, int* rnk, MPI_Offset *off);*/
 150 
 151 int mca_sharedfp_individual_insert_metadata(int functype,long recordlength,struct mca_sharedfp_base_data_t *sh );
 152 int mca_sharedfp_individual_write_metadata_file(struct mca_sharedfp_base_data_t *sh);
 153 /*MPI_Datatype mca_sharedfp_individual_create_datatype();*/
 154 /*int mca_sharedfp_individual_compute_highest_globalposition(MPI_Offset* global_off, int size);*/
 155 /*MPI_Offset mca_sharedfp_individual_get_last_offset(struct mca_sharedfp_file_handle *sh);*/
 156 
 157 double mca_sharedfp_individual_gettime(void);
 158 
 159 /*
 160  * ******************************************************************
 161  * ************ functions implemented in this module end ************
 162  * ******************************************************************
 163  */
 164 
 165 END_C_DECLS
 166 
 167 #endif /* MCA_SHAREDFP_INDIVIDUAL_H */

/* [<][>][^][v][top][bottom][index][help] */