/* * Copyright (C) 2015, UChicago Argonne, LLC * All Rights Reserved * * Generic IO (ANL-15-066) * Hal Finkel, Argonne National Laboratory * * OPEN SOURCE LICENSE * * Under the terms of Contract No. DE-AC02-06CH11357 with UChicago Argonne, * LLC, the U.S. Government retains certain rights in this software. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * 3. Neither the names of UChicago Argonne, LLC or the Department of Energy * nor the names of its contributors may be used to endorse or promote * products derived from this software without specific prior written * permission. * * ***************************************************************************** * * DISCLAIMER * THE SOFTWARE IS SUPPLIED “AS IS” WITHOUT WARRANTY OF ANY KIND. NEITHER THE * UNTED STATES GOVERNMENT, NOR THE UNITED STATES DEPARTMENT OF ENERGY, NOR * UCHICAGO ARGONNE, LLC, NOR ANY OF THEIR EMPLOYEES, MAKES ANY WARRANTY, * EXPRESS OR IMPLIED, OR ASSUMES ANY LEGAL LIABILITY OR RESPONSIBILITY FOR THE * ACCURACY, COMPLETENESS, OR USEFULNESS OF ANY INFORMATION, DATA, APPARATUS, * PRODUCT, OR PROCESS DISCLOSED, OR REPRESENTS THAT ITS USE WOULD NOT INFRINGE * PRIVATELY OWNED RIGHTS. * * ***************************************************************************** */ #include "gio.h" #include void read_gio_float(const MPI_Comm &C, char* file_name, char* var_name, float* data, int field_count){ read_gio(C, file_name,var_name,data,field_count); } void read_gio_double(const MPI_Comm &C, char* file_name, char* var_name, double* data, int field_count){ read_gio(C, file_name,var_name,data,field_count); } void read_gio_uint16(const MPI_Comm &C, char* file_name, char* var_name, uint16_t* data, int field_count){ read_gio(C, file_name,var_name,data,field_count); } void read_gio_int32(const MPI_Comm &C, char* file_name, char* var_name, int* data, int field_count){ read_gio(C, file_name,var_name,data,field_count); } void read_gio_int64(const MPI_Comm &C, char* file_name, char* var_name, int64_t* data, int field_count){ read_gio(C, file_name,var_name,data,field_count); } int64_t get_elem_num(const MPI_Comm &C, char* file_name){ gio::GenericIO reader(C, file_name); reader.openAndReadHeader(gio::GenericIO::MismatchAllowed); int num_ranks = reader.readNRanks(); uint64_t size = 0; for(int i =0;i VI; reader.openAndReadHeader(gio::GenericIO::MismatchAllowed); reader.getVariableInfo(VI); int num =VI.size(); for(int i =0;i VI; reader.openAndReadHeader(gio::GenericIO::MismatchAllowed); reader.getVariableInfo(VI); int num =VI.size(); for(int i =0;i VI; reader.openAndReadHeader(gio::GenericIO::MismatchAllowed); reader.getVariableInfo(VI); std::cout<<"Number of Elements: "< 1) std::cout<<"x"<