Commit 383950c6 authored by Gaurav Kukreja's avatar Gaurav Kukreja

Minor Bugs in script and bandwidth code resolved

Signed-off-by: 's avatarGaurav Kukreja <mailme.gaurav@gmail.com>
parent 1b859709
...@@ -13,5 +13,5 @@ ...@@ -13,5 +13,5 @@
source /etc/profile.d/modules.sh source /etc/profile.d/modules.sh
srun_ps /home/cluster/h039v/h039val/assign3/supercomputer/batch_scripts/run-mpi-test.sh ice > /home/cluster/h039v/h039val/assign3/tmp/out_ice_script.$JOB_ID.out srun_ps /home/cluster/h039v/h039val/assign3/supercomputer/batch_scripts/assign3/run-mpi-test.sh ice > /home/cluster/h039v/h039val/assign3/tmp/out_ice_script.$JOB_ID.out
...@@ -13,5 +13,5 @@ ...@@ -13,5 +13,5 @@
source /etc/profile.d/modules.sh source /etc/profile.d/modules.sh
srun_ps /home/cluster/h039v/h039val/assign3/supercomputer/batch_scripts/run-mpi-test.sh mpp > /home/cluster/h039v/h039val/assign3/tmp/out_mpp_script.$JOB_ID.out srun_ps /home/cluster/h039v/h039val/assign3/supercomputer/batch_scripts/assign3/run-mpi-test.sh mpp > /home/cluster/h039v/h039val/assign3/tmp/out_mpp_script.$JOB_ID.out
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#SBATCH -o /home/cluster/h039v/h039val/assign3/batch_result/heat.$JOB_ID.out #SBATCH -o /home/cluster/h039v/h039val/assign3/batch_result/heat.$JOB_ID.out
#SBATCH -D /home/cluster/h039v/h039val #SBATCH -D /home/cluster/h039v/h039val
#SBATCH -J mpi-uv #SBATCH -J mpi-uv
#SBATCH --clusters=uv3 #SBATCH --clusters=uv2
#SBATCH --get-user-env #SBATCH --get-user-env
#SBATCH --ntasks=128 #SBATCH --ntasks=128
#SBATCH --mail-type=end #SBATCH --mail-type=end
...@@ -13,5 +13,5 @@ ...@@ -13,5 +13,5 @@
source /etc/profile.d/modules.sh source /etc/profile.d/modules.sh
srun_ps /home/cluster/h039v/h039val/assign3/supercomputer/batch_scripts/run-mpi-test.sh uv > /home/cluster/h039v/h039val/assign3/tmp/out_uv_script.$JOB_ID.out srun_ps /home/cluster/h039v/h039val/assign3/supercomputer/batch_scripts/assign3/run-mpi-test.sh uv > /home/cluster/h039v/h039val/assign3/tmp/out_uv_script.$JOB_ID.out
...@@ -32,8 +32,8 @@ cd $PATH_SOURCE ...@@ -32,8 +32,8 @@ cd $PATH_SOURCE
rm -rf $OUTPUT_PATH rm -rf $OUTPUT_PATH
mkdir $OUTPUT_PATH mkdir $OUTPUT_PATH
make clean #make clean
make > $OUTPUT_PATH"/make-result-mpp.out" #make > $OUTPUT_PATH"/make-result-mpp.out"
for i in ${num_of_proc[@]} for i in ${num_of_proc[@]}
do do
...@@ -45,7 +45,7 @@ do ...@@ -45,7 +45,7 @@ do
$EXEC_CMD $i ./ping-pong $OUTPUT_PATH"/ping_pong_"$i".out" $EXEC_CMD $i ./ping-pong $OUTPUT_PATH"/ping_pong_"$i".out"
done done
for i in {num_of_proc[@]} for i in ${num_of_proc[@]}
do do
$EXEC_CMD $i ./ping-pong-bandwidth $OUTPUT_PATH"/bandwidth_"$i".out" $EXEC_CMD $i ./ping-pong-bandwidth $OUTPUT_PATH"/bandwidth_"$i".out"
done done
......
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
#define MAX_CMDARG 2 #define MAX_CMDARG 2
char *filename; char *filename;
#define PING_PONG_COUNT 100
struct data_bandwidth data_b; struct data_bandwidth data_b;
void usage() void usage()
...@@ -17,7 +19,7 @@ void usage() ...@@ -17,7 +19,7 @@ void usage()
int main (int argc, char **argv) int main (int argc, char **argv)
{ {
int my_proc, other_proc, i, j, nprocs, size; int my_proc, i, j, nprocs, size;
int tag=10; int tag=10;
char *msg; char *msg;
char *buffer; char *buffer;
...@@ -37,26 +39,25 @@ int main (int argc, char **argv) ...@@ -37,26 +39,25 @@ int main (int argc, char **argv)
{ {
for(i=1; i<nprocs; i++) for(i=1; i<nprocs; i++)
{ {
other_proc=i;
for(size=0; size<=20;size++) for(size=0; size<=20;size++)
{ {
buffer=malloc(pow(2,size)*sizeof(char)); buffer=malloc((pow(2,size)+5)*sizeof(char));
msg=calloc(pow(2, size),sizeof(char)); msg=calloc(pow(2, size),sizeof(char));
tstart = MPI_Wtime(); tstart = MPI_Wtime();
for(j=0; j<5; j++) for(j=0; j<PING_PONG_COUNT; j++)
{ {
MPI_Send(msg, pow(2, size), MPI_CHAR, other_proc, 10, MPI_COMM_WORLD); MPI_Send(msg, pow(2, size), MPI_CHAR, i, 10, MPI_COMM_WORLD);
MPI_Recv(buffer, pow(2, size), MPI_CHAR, other_proc, 10, MPI_COMM_WORLD, &status); MPI_Recv(buffer, pow(2, size), MPI_CHAR, i, 10, MPI_COMM_WORLD, &status);
} }
tend = MPI_Wtime(); tend = MPI_Wtime();
free(msg); free(msg);
free(buffer); free(buffer);
data_b.source_thread = 0; data_b.source_thread = 0;
data_b.dest_thread = other_proc; data_b.dest_thread = i;
data_b.log_size = size; data_b.log_size = size;
data_b.time = (tend - tstart)/10; data_b.time = (tend - tstart)/(2*PING_PONG_COUNT);
data_b.bandwidth = 0; data_b.bandwidth = pow(2, size)/data_b.time;
submit_bandwidth_data(data_b); submit_bandwidth_data(data_b);
} }
} }
...@@ -67,7 +68,7 @@ int main (int argc, char **argv) ...@@ -67,7 +68,7 @@ int main (int argc, char **argv)
{ {
buffer=malloc(pow(2,size)*sizeof(char)); buffer=malloc(pow(2,size)*sizeof(char));
for(j=0; j<5; j++) for(j=0; j<PING_PONG_COUNT; j++)
{ {
MPI_Recv(buffer, pow(2,size), MPI_CHAR, 0, 10, MPI_COMM_WORLD, &status); MPI_Recv(buffer, pow(2,size), MPI_CHAR, 0, 10, MPI_COMM_WORLD, &status);
MPI_Send(buffer, pow(2,size), MPI_CHAR, 0, 10, MPI_COMM_WORLD); MPI_Send(buffer, pow(2,size), MPI_CHAR, 0, 10, MPI_COMM_WORLD);
......
...@@ -8,9 +8,9 @@ int submit_bandwidth_data(struct data_bandwidth data_b) ...@@ -8,9 +8,9 @@ int submit_bandwidth_data(struct data_bandwidth data_b)
FILE* fp; FILE* fp;
fp = fopen(filename, "a"); fp = fopen(filename, "a");
fprintf(fp, "%d\t%d\t%d\t%lf\t%lf\n", data_b.source_thread, fprintf(fp, "%d\t%d\t%d\t%lf\t%lf MB/s\n", data_b.source_thread,
data_b.dest_thread, data_b.log_size, data_b.dest_thread, data_b.log_size,
data_b.time, data_b.bandwidth); data_b.time, data_b.bandwidth/1000000);
fclose(fp); fclose(fp);
return 1; return 1;
......
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