Skip to content
Snippets Groups Projects
Commit daad7db7 authored by wfg's avatar wfg
Browse files

Initial implementation of BPWriter and BP1Writer

Added -Wl,-rpath to Makefiles in DataMan examples
Added more variables to buildDataMan.sh
parent 2841268b
No related branches found
No related tags found
1 merge request!8Integrate groupless
...@@ -6,18 +6,25 @@ ...@@ -6,18 +6,25 @@
# Author: wfg # Author: wfg
DATAMAN_LOCATION=/home/wfg/Applications/DataMan DATAMAN_LOCATION=/home/wfg/Applications/DataMan
MPICOMPILER=mpic++
if [ "$(uname)" == "Darwin" ]; then
CCOMPILER=g++-6
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
CCOMPILER=g++
fi
echo "######################################################################################" echo "######################################################################################"
echo "Start building ADIOS ./lib/libadios.a ./libadios_nompi.a with DataMan library" echo "Start building ADIOS ./lib/libadios.a ./libadios_nompi.a with DataMan library"
echo "######################################################################################" echo "######################################################################################"
echo echo
make HAVE_DATAMAN=yes DATAMAN_LOC=$DATAMAN_LOCATION #build the ./lib/libadios.a and ./libadios_nompi.a make HAVE_DATAMAN=yes DATAMAN_LOC=$DATAMAN_LOCATION CC=$CCOMPILER MPICC=$MPICOMPILER #build the ./lib/libadios.a and ./libadios_nompi.a
echo echo
echo "#################################################################" echo "#################################################################"
echo "Building Dataman Reader and Writer examples" echo "Building Dataman Reader and Writer examples"
echo "#################################################################" echo "#################################################################"
make -C ./examples/hello/datamanWriter HAVE_DATAMAN=yes DATAMAN_LOC=$DATAMAN_LOCATION make -C ./examples/hello/datamanWriter HAVE_DATAMAN=yes DATAMAN_LOC=$DATAMAN_LOCATION CC=$CCOMPILER MPICC=$MPICOMPILER
echo echo
make -C ./examples/hello/datamanReader HAVE_DATAMAN=yes DATAMAN_LOC=$DATAMAN_LOCATION make -C ./examples/hello/datamanReader HAVE_DATAMAN=yes DATAMAN_LOC=$DATAMAN_LOCATION CC=$CCOMPILER MPICC=$MPICOMPILER
echo echo
echo echo
......
...@@ -20,8 +20,8 @@ INC+= -I$(ADIOS_DIR)/include ...@@ -20,8 +20,8 @@ INC+= -I$(ADIOS_DIR)/include
#DATAMAN #DATAMAN
DATAMAN_LOC=/home/wfg/Applications/DataMan DATAMAN_LOC=/home/wfg/Applications/DataMan
INC+= -I$(DATAMAN_LOC)/include INC+= -I$(DATAMAN_LOC)/include
LIB+= -L$(DATAMAN_LOC)/lib -ldataman # -lcacheman -lstreamman -lzmqman LIB+= -Wl,-rpath=$(DATAMAN_LOC)/lib -L$(DATAMAN_LOC)/lib -ldataman # -lcacheman -lstreamman -lzmqman
LIB_NOMPI+= -L$(DATAMAN_LOC)/lib -ldataman LIB_NOMPI+= -Wl,-rpath=$(DATAMAN_LOC)/lib -L$(DATAMAN_LOC)/lib -ldataman
#COMPILER FLAGS #COMPILER FLAGS
CFLAGS=-Wall -O0 -g -Wpedantic -std=c++11 CFLAGS=-Wall -O0 -g -Wpedantic -std=c++11
......
...@@ -20,8 +20,8 @@ INC+= -I$(ADIOS_DIR)/include ...@@ -20,8 +20,8 @@ INC+= -I$(ADIOS_DIR)/include
#DATAMAN #DATAMAN
DATAMAN_LOC=/home/wfg/Applications/DataMan DATAMAN_LOC=/home/wfg/Applications/DataMan
INC+= -I$(DATAMAN_LOC)/include INC+= -I$(DATAMAN_LOC)/include
LIB+= -L$(DATAMAN_LOC)/lib -ldataman # -lcacheman -lstreamman -lzmqman LIB+= -Wl,-rpath=$(DATAMAN_LOC)/lib -L$(DATAMAN_LOC)/lib -ldataman # -lcacheman -lstreamman -lzmqman
LIB_NOMPI+= -L$(DATAMAN_LOC)/lib -ldataman # -lcacheman -lstreamman -lzmqman LIB_NOMPI+= -Wl,-rpath=$(DATAMAN_LOC)/lib -L$(DATAMAN_LOC)/lib -ldataman # -lcacheman -lstreamman -lzmqman
#COMPILER FLAGS #COMPILER FLAGS
CFLAGS=-Wall -O0 -g -Wpedantic -std=c++11 CFLAGS=-Wall -O0 -g -Wpedantic -std=c++11
......
...@@ -74,6 +74,10 @@ public: ...@@ -74,6 +74,10 @@ public:
void AdvanceStep( ); void AdvanceStep( );
/**
* Closes a single transport or all transports
* @param transportIndex, if -1 (default) closes all transports, otherwise it closes a transport in m_Transport[transportIndex]. In debug mode the latter is bounds-checked.
*/
void Close( const int transportIndex = -1 ); void Close( const int transportIndex = -1 );
private: private:
...@@ -81,7 +85,7 @@ private: ...@@ -81,7 +85,7 @@ private:
capsule::STLVector m_Buffer; ///< heap capsule using STL std::vector<char> capsule::STLVector m_Buffer; ///< heap capsule using STL std::vector<char>
std::size_t m_BufferVariableCountPosition = 0; ///< needs to be updated in every advance step std::size_t m_BufferVariableCountPosition = 0; ///< needs to be updated in every advance step
bool m_IsFirstClose = true; ///< set to false after first Close is reached so metadata doesn't have to be accommodated for a subsequent Close bool m_IsFirstClose = true; ///< set to false after first Close is reached so metadata doesn't have to be accommodated for a subsequent Close
std::size_t m_MaxBufferSize; std::size_t m_MaxBufferSize; ///< maximum allowed memory to be allocated
float m_GrowthFactor = 1.5; ///< capsule memory growth factor, new_memory = m_GrowthFactor * current_memory float m_GrowthFactor = 1.5; ///< capsule memory growth factor, new_memory = m_GrowthFactor * current_memory
format::BP1Writer m_BP1Writer; ///< format object will provide the required BP functionality to be applied on m_Buffer and m_Transports format::BP1Writer m_BP1Writer; ///< format object will provide the required BP functionality to be applied on m_Buffer and m_Transports
......
...@@ -177,19 +177,6 @@ void BPWriter::Close( const int transportIndex ) ...@@ -177,19 +177,6 @@ void BPWriter::Close( const int transportIndex )
{ {
m_BP1Writer.Close( m_MetadataSet, m_Buffer, *m_Transports[transportIndex], m_IsFirstClose ); m_BP1Writer.Close( m_MetadataSet, m_Buffer, *m_Transports[transportIndex], m_IsFirstClose );
} }
//BP1Writer to update the metadata indices
//merge all metadata indices in capsule.m_Metadata buffer or capsule.m_Data buffer (depends on transport predefined functionality)
//BP1BPWriter to write to corresponding transport
//Close the corresponding transport
} }
......
...@@ -253,7 +253,7 @@ void BP1Writer::FlattenMetadata( BP1MetadataSet& metadataSet, Capsule& capsule ) ...@@ -253,7 +253,7 @@ void BP1Writer::FlattenMetadata( BP1MetadataSet& metadataSet, Capsule& capsule )
const std::uint64_t offsetPGIndex = capsule.m_DataAbsolutePosition; const std::uint64_t offsetPGIndex = capsule.m_DataAbsolutePosition;
const std::uint64_t offsetVarsIndex = offsetPGIndex + pgLength; const std::uint64_t offsetVarsIndex = offsetPGIndex + pgLength;
const std::uint64_t offsetAttributeIndex = offsetVarsIndex + varsIndexLength; const std::uint64_t offsetAttributeIndex = offsetVarsIndex + varsIndexLength;
std::size_t position = attributesIndexLength; std::size_t position = pgLength + varsIndexLength + attributesIndexLength;
//offsets //offsets
std::memcpy( &metadata[position], &offsetPGIndex, 8 ); std::memcpy( &metadata[position], &offsetPGIndex, 8 );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment