Commit df0bb860 authored by gsaxena's avatar gsaxena

Commit January 2020 - X decomposition of first trivial example of BioFVM (Work done in 2019)

parent c8a5bf8b
......@@ -988,8 +988,8 @@ for(int ser_ctr=0; ser_ctr <= size-1; ser_ctr++)
for( int i=1; i < M.mesh.x_coordinates.size() ; i++ )
{
int n = M.voxel_index(i,j,k);
int n1 = M.voxel_index(i-1,j,k); //Can remove this overhead of finding index now
axpy( &(*M.p_density_vectors)[n] , M.thomas_constant1 , (*M.p_density_vectors)[n1] );
//int n1 = M.voxel_index(i-1,j,k); //Can remove this overhead of finding index now
axpy( &(*M.p_density_vectors)[n] , M.thomas_constant1 , (*M.p_density_vectors)[n-M.thomas_i_jump] );
(*M.p_density_vectors)[n] /= M.thomas_denomx[i];
}
}
......@@ -1009,8 +1009,8 @@ for(int ser_ctr=0; ser_ctr <= size-1; ser_ctr++)
for( int i=1; i < M.mesh.x_coordinates.size() ; i++ )
{
int n = M.voxel_index(i,j,k);
int n1 = M.voxel_index(i-1,j,k);
axpy( &(*M.p_density_vectors)[n] , M.thomas_constant1 , (*M.p_density_vectors)[n1] );
//int n1 = M.voxel_index(i-1,j,k);
axpy( &(*M.p_density_vectors)[n] , M.thomas_constant1 , (*M.p_density_vectors)[n-M.thomas_i_jump] );
(*M.p_density_vectors)[n] /= M.thomas_denomx[i];
}
}
......@@ -1074,8 +1074,8 @@ for(int ser_ctr=0; ser_ctr <= size-1; ser_ctr++)
for( int i=M.mesh.x_coordinates.size()-2; i>=0 ; i-- )
{
int n = M.voxel_index(i,j,k);
int n2 = M.voxel_index(i+1,j,k); //can remove overhead of finding index here
naxpy( &(*M.p_density_vectors)[n] , M.thomas_cx[i] , (*M.p_density_vectors)[n2] );
//int n2 = M.voxel_index(i+1,j,k); //can remove overhead of finding index here
naxpy( &(*M.p_density_vectors)[n] , M.thomas_cx[i] , (*M.p_density_vectors)[n+M.thomas_i_jump] );
}
}
}
......@@ -1093,8 +1093,8 @@ for(int ser_ctr=0; ser_ctr <= size-1; ser_ctr++)
for( int i=M.mesh.x_coordinates.size()-2; i >=0; i-- )
{
int n = M.voxel_index(i,j,k);
int n2 = M.voxel_index(i+1,j,k);
naxpy( &(*M.p_density_vectors)[n] , M.thomas_cx[i] , (*M.p_density_vectors)[n2] );
//int n2 = M.voxel_index(i+1,j,k);
naxpy( &(*M.p_density_vectors)[n] , M.thomas_cx[i] , (*M.p_density_vectors)[n+M.thomas_i_jump] );
}
}
}
......
No preview for this file type
......@@ -68,7 +68,7 @@ using namespace BioFVM;
//int omp_num_threads = 48; // set number of threads for parallel computing, set this to # of CPU cores x 2 (for hyperthreading)
#define N 3840
double pi= 3.1415926535897932384626433832795;
double UniformRandom()
......@@ -125,7 +125,7 @@ void create_point_sources(double cell_radius, double dt, int num_sources, Microe
/*------------------------------------------------------------------------------------------------*/
for(int j=0; j < 3 ; j++ )
tempPoint[j] = UniformRandom()*1000;
tempPoint[j] = UniformRandom()*N;
/*------------------------------------------------------------------------------------------------*/
/* Find the MPI process coordinate using local_x/y/z_voxels */
......@@ -296,7 +296,7 @@ void create_point_sinks(double cell_radius, double dt, int num_sinks, Microenvir
/*------------------------------------------------------------------------------------------------*/
for(int j=0; j < 3 ; j++ )
tempPoint[j] = UniformRandom()*1000;
tempPoint[j] = UniformRandom()*N;
/*------------------------------------------------------------------------------------------------*/
/* Find the MPI process coordinate using local_x/y/z_voxels */
......@@ -416,7 +416,7 @@ void create_point_sinks(double cell_radius, double dt, int num_sinks, Microenvir
int main( int argc, char* argv[] )
{
double minX=0, minY=0, minZ=0, maxX=1440, maxY=1440, maxZ=1440, mesh_resolution=10;
double minX=0, minY=0, minZ=0, maxX=N, maxY=N, maxZ=N, mesh_resolution=10;
/*--------------------------------------------*/
/* Initialize MPI */
......@@ -455,7 +455,9 @@ int main( int argc, char* argv[] )
/* Right now it should be 1-D Z decomposition */
/*------------------------------------------------------------*/
//std::cout<<"Data sizes"<<std::endl;
//std::cout<<"INTEGER="<<sizeof(int)<<" bytes"<<std::endl;
mpi_Dims[0] = 1;
mpi_Dims[1] = mpi_Size; //Number of Y processes, since Y-processes divide X-axis, we have X-decomposition
mpi_Dims[2] = 1;
......@@ -538,7 +540,7 @@ int main( int argc, char* argv[] )
std::cout<<"TIME FOR GENERATING GAUSSIAN PROFILE = "<< (t_end-t_start)<< std::endl;
t_start = MPI_Wtime();
microenvironment.write_to_matlab( "initial_concentration.mat", mpi_Rank, mpi_Size, mpi_Cart_comm );
microenvironment.write_to_matlab( "/gpfs/projects/bsc99/BioFVM_Files/initial_concentration.mat", mpi_Rank, mpi_Size, mpi_Cart_comm );
t_end = MPI_Wtime();
if(mpi_Rank==0)
std::cout<<"TIME FOR WRITING INITIAL CONCENTRATION FILE = "<< (t_end-t_start)<< std::endl;
......@@ -581,7 +583,7 @@ int main( int argc, char* argv[] )
std::cout<<"TIME FOR SIMULATING (SOURCES+SINKS+DIFFUSION) = "<< (t_end-t_start)<< std::endl;
t_start = MPI_Wtime();
microenvironment.write_to_matlab( "final.mat", mpi_Rank, mpi_Size, mpi_Cart_comm ); //Remember to use Parallel Version !
microenvironment.write_to_matlab( "/gpfs/projects/bsc99/BioFVM_Files/final.mat", mpi_Rank, mpi_Size, mpi_Cart_comm ); //Remember to use Parallel Version !
t_end = MPI_Wtime();
if(mpi_Rank==0)
std::cout<<"TIME FOR WRITING FINAL FILE = "<< (t_end-t_start)<< std::endl;
......
#!/bin/bash
#SBATCH -n 48
#SBATCH --nodes=16
#SBATCH --ntasks-per-node=2
#SBATCH -t 08:00:00
#SBATCH --cpus-per-task=1
#SBATCH -o output-%j
#SBATCH -e error-%j
#SBATCH --x11=batch
#SBATCH --exclusive
# set application and parameters
export OMP_NUM_THREADS=1
ddt mpiexec -n 1 ./examples/tutorial1
export OMP_NUM_THREADS=24
export OMP_PROC_BIND=spread
ddt mpiexec --map-by socket --bind-to socket ./examples/tutorial1
#!/bin/bash
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=48
#SBATCH -t 08:00:00
#SBATCH --cpus-per-task=1
#SBATCH -o output-%j
#SBATCH -e error-%j
#SBATCH --x11=batch
#SBATCH --exclusive
# set application and parameters
#module load octave
octave --force-gui
#!/bin/bash
#SBATCH --nodes=4
#SBATCH --ntasks-per-node=2
#SBATCH --cpus-per-task=24
#SBATCH -t 00:15:00
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=1
#SBATCH --cpus-per-task=48
#SBATCH -t 00:60:00
#SBATCH -o output-%j
#SBATCH -e error-%j
#SBATCH --exclusive
#export OMP_SCHEDULE=STATIC
export OMP_DISPLAY_ENV=true
export OMP_NUM_THREADS=24
export OMP_NUM_THREADS=48
export OMP_PROC_BIND=spread
#export OMP_PLACES="{0:1}:48:1"
export OMP_PLACES=threads
mpiexec --map-by ppr:1:socket:pe=24 --report-bindings ./examples/tutorial1
export OMP_PLACES='cores(48)'
#mpiexec --map-by ppr:1:socket:pe=24 --report-bindings ./examples/tutorial1
mpiexec --report-bindings --map-by node --bind-to none ./examples/tutorial1
#mpiexec --map-by socket --bind-to core --report-bindings ./examples/tutorial1
#mpiexec --map-by node --bind-to none --report-bindings ./examples/tutorial1
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