Commit 0ecb4c0e authored by Francois Tessier's avatar Francois Tessier

Fix architecture abstraction

parent af13cb69
......@@ -6,6 +6,11 @@
/**********************/
/* |-- Nodes */
/**********************/
int Topology::IONodesPerFile ( char* filename, int *nodesList ) {
return 1;
}
int Topology::IONodeId () {
return MPIX_IO_node_id ();
}
......@@ -20,6 +25,13 @@ int Topology::ComputeNodeId () {
return 0;
}
int Topology::GlobalCoreId () {
return 0;
}
int Topology::LocalCoreId () {
return 0;
}
int Topology::ProcessPerNode () {
MPIX_Hardware_t hw;
......@@ -28,12 +40,6 @@ int Topology::ProcessPerNode () {
return hw.ppn;
}
int Topology::IONodesPerFile ( char* filename, int *nodesList ) {
return 1;
}
/**********************/
/* |-- Network */
/**********************/
......
......@@ -21,11 +21,13 @@ public:
/**********************/
/* |-- Nodes */
/**********************/
int IONodesPerFile ( char* filename, int *nodesList );
int IONodeId ();
int BridgeNodeId ();
int ComputeNodeId ();
int GlobalCoreId ();
int LocalCoreId ();
int ProcessPerNode ();
int IONodesPerFile ( char* filename, int *nodesList );
/**********************/
/* |-- Network */
......
......@@ -44,6 +44,7 @@ void Memory::memAlloc ( int64_t buffSize, mem_t mem, bool masterRank, char* file
printMsg ( DEBUG, "Connect to the RAN volume (%s:%d)\n", __FILE__, __LINE__ );
}
kdsa_connect(this->RAN_volume_, 0, &this->RAN_handle_);
MPI_Barrier (this->comm_);
break;
case NLS:
case PFS:
......@@ -129,6 +130,7 @@ void Memory::memFree ( ) {
}
break;
case NAM:
sleep (20);
kdsa_disconnect (this->RAN_handle_);
break;
case NLS:
......@@ -175,14 +177,38 @@ int Memory::memWrite ( void* srcBuffer, int64_t srcSize, int64_t offset, int des
err = MPI_Put ( srcBuffer, srcSize, MPI_BYTE, destRank, offset, srcSize, MPI_BYTE, this->RMAWin_ );
break;
case NAM:
sleep (2);
kdsa_mem_key_t key;
printMsg ( DEBUG, "kdsa_write at offset %lld, size %lld\n", offset, srcSize );
kdsa_register_mem (this->RAN_handle_, srcBuffer, srcSize, &key);
kdsa_write (this->RAN_handle_, key, offset, srcBuffer, srcSize);
kdsa_memory_barrier (this->RAN_handle_);
kdsa_deregister_mem(key);
break;
case NLS:
case PFS:
err = MPI_File_write_at ( this->fileHandle_, offset, srcBuffer, srcSize, MPI_BYTE, &status );
if ( this->memSrc_ == NAM ) {
sleep (10);
printMsg ( DEBUG, "BEG kdsa_read at offset %lld, size %lld (PFS)\n", offset, srcSize );
kdsa_mem_key_t key;
void *buffer;
buffer = malloc ( srcSize );
printMsg ( DEBUG, "malloc\n");
sleep (1);
kdsa_register_mem (this->RAN_handle_, buffer, srcSize, &key);
printMsg ( DEBUG, "kdsa_register_mem\n");
sleep (1);
kdsa_read (this->RAN_handle_, key, 0, buffer, srcSize);
//kdsa_read_unregistered (this->RAN_handle_, 0, buffer, srcSize);
printMsg ( DEBUG, "kdsa_read\n");
kdsa_memory_barrier (this->RAN_handle_);
printMsg ( DEBUG, "kdsa_memory_barrier\n");
kdsa_deregister_mem(key);
printMsg ( DEBUG, "END kdsa_read at offset %lld, size %lld (PFS)\n", offset, srcSize );
err = MPI_File_write_at ( this->fileHandle_, offset, srcBuffer, srcSize, MPI_BYTE, &status );
}
else
err = MPI_File_write_at ( this->fileHandle_, offset, srcBuffer, srcSize, MPI_BYTE, &status );
break;
default:
printMsg ( ERROR, "Error while writing data (mem = %s)\n", this->memName () );
......@@ -212,6 +238,13 @@ int Memory::memRead ( void* srcBuffer, int64_t srcSize, int64_t offset, int des
case NLS:
case PFS:
err = MPI_File_read_at ( this->fileHandle_, offset, srcBuffer, srcSize, MPI_BYTE, &status );
if ( this->memSrc_ == NAM ) {
kdsa_mem_key_t key;
kdsa_register_mem (this->RAN_handle_, srcBuffer, srcSize, &key);
kdsa_write (this->RAN_handle_, key, 0, srcBuffer, srcSize);
kdsa_memory_barrier (this->RAN_handle_);
kdsa_deregister_mem(key);
}
break;
default:
printMsg ( ERROR, "Error while reading data (mem = %s)\n", this->memName () );
......@@ -234,6 +267,7 @@ int Memory::memFlush ( ) {
MPI_Win_fence ( 0, this->RMAWin_ );
break;
case NAM:
sleep (2);
kdsa_memory_barrier (this->RAN_handle_);
break;
case NLS:
......
......@@ -161,7 +161,7 @@ void Topology::IONodeCoordinates ( int* coord ) {
/* |---- Distance */
int Topology::DistanceToIONode ( int srcRank ) {
return 0;
return 1;
}
/* Minimal distance between two ranks considering a dragonfly network */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment