Commit f45670e2 authored by Francois Tessier's avatar Francois Tessier

Use the new TAPIOCA API in the 1D-array example

parent 4f7c8599
......@@ -12,6 +12,9 @@
#define BLUE "\x1b[34m"
#define RESET "\x1b[0m"
mem_t memAggr = DDR;
mem_t memTarg = HDD;
int64_t particles (int64_t max, int rank) {
int64_t n_part;
......@@ -41,8 +44,8 @@ int main (int argc, char * argv[])
MPI_Comm_size(MPI_COMM_WORLD, &world_numtasks);
MPI_Comm_rank(MPI_COMM_WORLD, &world_myrank);
mycolor = tp.topology.BridgeNodeId ();
//mycolor = 42;
//mycolor = tp.topology.BridgeNodeId ();
mycolor = 42;
mykey = world_myrank;
MPI_Comm_split (MPI_COMM_WORLD, mycolor, mykey, &sub_comm);
......@@ -79,13 +82,6 @@ int main (int argc, char * argv[])
file_size = particle_size * sub_particles;
tot_size = particle_size * tot_particles;
if (sub_myrank == 0) {
MPI_File_open(MPI_COMM_SELF, output,
MPI_MODE_WRONLY | MPI_MODE_CREATE, MPI_INFO_NULL, &file_handle);
MPI_File_set_size(file_handle, file_size);
MPI_File_close (&file_handle);
}
MPI_Exscan (&num_particles, &scan_size, 1, MPI_LONG_LONG, MPI_SUM, sub_comm);
if (0 == sub_myrank) {
......@@ -102,24 +98,19 @@ int main (int argc, char * argv[])
chunkCount[0] = num_particles;
chunkSize[0] = sizeof(float);
chunkOffset[0] = hdr + scan_size * particle_size;
tp.WriteInitialize (output, chunkCount, chunkSize, chunkOffset, 1, hdr, ARRAY_OF_STRUCTURES, sub_comm);
tp.Init (chunkCount, chunkSize, chunkOffset, 1, hdr, sub_comm);
tp.setAggregationTier (2, memAggr, "/scratch/tmp-write");
tp.setTargetTier (memTarg, file_size, output);
/*****************/
MPI_Barrier (MPI_COMM_WORLD);
start_time = MPI_Wtime();
MPI_File_open(sub_comm, output,
MPI_MODE_WRONLY, MPI_INFO_NULL, &file_handle);
MPIIOInfo ( file_handle );
offset = scan_size * particle_size;
tp.Write (file_handle, offset, xx, num_particles, MPI_FLOAT, &status);
tp.Write (offset, xx, num_particles, MPI_FLOAT, &status);
MPI_File_close (&file_handle);
end_time = MPI_Wtime();
tot_time = end_time - start_time;
MPI_Reduce (&tot_time, &max_time, 1, MPI_DOUBLE, MPI_MAX, 0, MPI_COMM_WORLD);
......@@ -129,9 +120,11 @@ int main (int argc, char * argv[])
fprintf (stdout, BLUE "[TIMING]" RESET " Write I/O bandwidth: %.2f MBps (%.2f MB in %.2f ms)\n",
io_bw, (double)tot_size/(1024*1024), max_time * 1000);
}
tp.Finalize ();
MPI_Barrier (MPI_COMM_WORLD);
tp.Finalize ();
/*****************/
/* READ */
......@@ -142,23 +135,20 @@ int main (int argc, char * argv[])
/*****************/
/* INIT TAPIOCA */
/*****************/
tp.ReadInitialize (output, chunkCount, chunkSize, chunkOffset, 1, hdr, ARRAY_OF_STRUCTURES, sub_comm);
tp.Init (chunkCount, chunkSize, chunkOffset, 1, hdr, sub_comm);
tp.setAggregationTier (2, memAggr, "/scratch/tmp-read");
tp.setTargetTier (memTarg, file_size, output);
/*****************/
start_time = MPI_Wtime();
MPI_File_open(sub_comm, output,
MPI_MODE_RDONLY, MPI_INFO_NULL, &file_handle);
if (0 == sub_myrank)
fprintf (stdout, GREEN "[INFO]" RESET " [%08d] Read output file\n", mycolor);
offset = scan_size * particle_size;
tp.Read (file_handle, offset, xx_r, num_particles, MPI_FLOAT, &status);
tp.Read (offset, xx_r, num_particles, MPI_FLOAT, &status);
MPI_File_close (&file_handle);
end_time = MPI_Wtime();
tot_time = end_time - start_time;
MPI_Reduce (&tot_time, &max_time, 1, MPI_DOUBLE, MPI_MAX, 0, MPI_COMM_WORLD);
......@@ -169,6 +159,10 @@ int main (int argc, char * argv[])
io_bw, (double)tot_size/(1024*1024), max_time * 1000);
}
MPI_Barrier (MPI_COMM_WORLD);
tp.Finalize ();
/*****************/
/* VERIFICATION */
/*****************/
......
#!/bin/bash
NODES=1024
NODES=8
PPN=16
NPROCS=$((NODES*PPN))
TARGET="/projects/visualization/ftessier/debug"
......@@ -11,8 +11,9 @@ export TAPIOCA_DEVNULL=false
export TAPIOCA_COMMSPLIT=true
export TAPIOCA_STRATEGY=TOPOLOGY_AWARE
export TAPIOCA_NBAGGR=4
export TAPIOCA_BUFFERSIZE=33554432
export TAPIOCA_BUFFERSIZE=4194304
export TAPIOCA_PIPELINING=true
export TAPIOCA_REELECTAGGR=true
function updateSettings()
{
......@@ -23,6 +24,7 @@ function updateSettings()
SETTINGS="$SETTINGS TAPIOCA_NBAGGR=$TAPIOCA_NBAGGR"
SETTINGS="$SETTINGS TAPIOCA_BUFFERSIZE=$TAPIOCA_BUFFERSIZE"
SETTINGS="$SETTINGS TAPIOCA_PIPELINING=$TAPIOCA_PIPELINING"
SETTINGS="$SETTINGS TAPIOCA_REELECTAGGR=$TAPIOCA_REELECTAGGR"
SETTINGS="$SETTINGS PAMID_VERBOSE=1"
SETTINGS="$SETTINGS PAMID_COLLECTIVES_MEMORY_OPTIMIZED=1"
......@@ -41,10 +43,10 @@ function outputFile ()
}
PARTICLES=25000
for RUN in 1 2 3 4 5
PARTICLES=50000
for RUN in 1
do
for AGGR in 4 8 16 32 64
for AGGR in 2
do
export TAPIOCA_NBAGGR=$AGGR
updateSettings
......@@ -54,9 +56,9 @@ do
runjob --block $COBALT_PARTNAME --envs $SETTINGS -p $PPN --np $NPROCS : ./main_tapioca $PARTICLES >> $OUTPUT
sleep 5
rm $TARGET/*
outputFile "MPIIO"
runjob --block $COBALT_PARTNAME --envs $SETTINGS -p $PPN --np $NPROCS : ./main_mpiio $PARTICLES >> $OUTPUT
sleep 5
# rm $TARGET/*
# outputFile "MPIIO"
# runjob --block $COBALT_PARTNAME --envs $SETTINGS -p $PPN --np $NPROCS : ./main_mpiio $PARTICLES >> $OUTPUT
# sleep 5
done
done
\ No newline at end of file
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