tapioca_f90api.cpp 1.61 KB
Newer Older
1
#include "tapioca_f90api.h"
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
#include "tapioca_singleton.hpp"

void tapioca_init_ ( int64_t *chunkCount, int *chunkSize,
		     int64_t *chunkOffset, int *nChunks, int64_t *header, MPI_Fint *comm) 
{
  int nChunks_    = *nChunks;
  int64_t header_ = (int64_t)*header;
  MPI_Comm comm_  = MPI_Comm_f2c ( *comm );
  
  Tapioca_S::getInstance()->Init ( chunkCount, chunkSize, chunkOffset, nChunks_, header_, comm_ );
  Tapioca_S::getInstance()->setAggregationTier ( 2, DDR, "" );
  Tapioca_S::getInstance()->setTargetTier ( HDD, 7680000, "/projects/visualization/ftessier/debug/f90_HACC.dat" );
}

void tapioca_set_aggregation_tier_ ( int nBuffers, mem_t mem, char* fileName ) 
{
  Tapioca_S::getInstance()->setAggregationTier ( nBuffers, mem, fileName );
}

void tapioca_set_target_tier_ ( mem_t mem, int64_t buffSize, char* fileName )
{
  Tapioca_S::getInstance()->setTargetTier ( mem, buffSize, fileName );
}

int tapioca_write_ ( MPI_Offset* offset, void *buf, int* count,
		     MPI_Fint* datatype, MPI_Status *status )
{
  MPI_Datatype datatype_  = MPI_Type_f2c ( *datatype );
  MPI_Offset offset_      = *offset;
  int count_              = *count;

  return Tapioca_S::getInstance()->Write ( offset_, buf, count_, datatype_, status );
}

int tapioca_read_  ( MPI_Offset* offset, void *buf, int* count,
		     MPI_Fint* datatype, MPI_Status *status )
{
  MPI_Datatype datatype_  = MPI_Type_f2c ( *datatype );
  MPI_Offset offset_      = *offset;
  int count_              = *count;

  return Tapioca_S::getInstance()->Read ( offset_, buf, count_, datatype_, status );
}

void tapioca_finalize_ ( )
{
  Tapioca_S::getInstance()->Finalize ();
}