Changeset 694

Show
Ignore:
Timestamp:
10/28/09 00:16:03 (4 weeks ago)
Author:
kgao
Message:

add 'multiple write operations of single non-record variable' test

Location:
trunk/test/mcoll_perf
Files:
1 added
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/test/mcoll_perf/Makefile.in

    r666 r694  
    1010CFLAGS          = @CFLAGS@ $(INCLUDES)  
    1111 
    12 SRCS            = mcoll_perf.c single_mcoll_perf_record.c 
     12SRCS            = mcoll_perf.c single_mcoll_perf_record.c single_mcoll_perf_non_record.c  
    1313OBJS            = $(SRCS:.c=.o) 
    14 PROGS           = mcoll_perf single_mcoll_perf_record 
     14PROGS           = mcoll_perf single_mcoll_perf_record single_mcoll_perf_non_record 
    1515LDFLAGS         = -L$(LIBDIR) -L../common @LDFLAGS@ 
    1616LIBS            = -lpnetcdf -ltestutils @LIBS@ 
     
    2525single_mcoll_perf_record: single_mcoll_perf_record.o 
    2626        $(CC) -g -o $@ $@.o $(LDFLAGS) $(LIBS) 
     27single_mcoll_perf_record: single_mcoll_perf_non_record.o 
     28        $(CC) -g -o $@ $@.o $(LDFLAGS) $(LIBS) 
    2729 
    2830clean: 
  • trunk/test/mcoll_perf/go

    r658 r694  
    1 mpiexec -n 4 mcoll_perf 32 4 1 3 1 -fname /pvfs2/kgao/mvars/test1 
     1mpiexec -n 4 mcoll_perf 32 4 1 3 1 -fname /pvfs2/kgao/mvars/test1 //combine multiple variable write options in one collective write  
    22 
    33 
     
    1919                               ! 1: record variables 
    2020 
    21 mpiexec -n 4 single_mcoll_perf 32 4 1 3 -fname /pvfs2/kgao/mvars/test1 
     21mpiexec -n 4 single_mcoll_perf_record 32 4 1 3 -fname /pvfs2/kgao/mvars/test1 //multiple write operations of single record variable  
     22mpiexec -n 4 single_mcoll_perf_non_record 32 4 1 3 -fname /pvfs2/kgao/mvars/test1 //multiple write operations of single non-record variable 
    2223 
    2324argv[1]    length              ! global array size in X, Y and Z 
    2425                                 array_of_gsizes[0] = array_of_gsizes[1] = array_of_gsizes[2] = length; 
    25 argv[2]    nvars               ! number of write  
     26argv[2]    ntimes              ! number of write  
    2627argv[3]    k_loop              ! number of loop for test 
    2728argv[4]    mvar_flag           ! 0: original ncmpi_put_vara_all 
  • trunk/test/mcoll_perf/mcoll_perf.c

    r691 r694  
    329329      } 
    330330 
    331       file_size = 1024+nvars*array_of_gsizes[0]*array_of_gsizes[1]*array_of_gsizes[2]*sizeof(int); 
    332       write_bw = file_size/new_run_tim[top]/1024.0/1024.0; 
    333331      fprintf(stderr, "mvar nvars:%d, Global array size %d x %d x %d integers, local array size: %d x %d x%d, filesize:%d\n", nvars, array_of_gsizes[0], array_of_gsizes[1], array_of_gsizes[2],sizes[0], sizes[1], sizes[2], file_size); 
    334       fprintf(stderr, "%dx%dx%d, %d: nvars:%d, loop:%d, k:%d, open_t = %f, def_t =%f, write_t = %f sec,run_t = %f sec, filesize: %ld, bandwidth = %f Mbytes/sec\n", sizes[0], sizes[1], sizes[2],mvar_flag, nvars, k_loop, top, new_open_tim[top], new_def_tim[top], new_write_tim[top], new_run_tim[top],file_size, write_bw);  
     332      fprintf(stderr, "%dx%dx%d, %d: nvars:%d, loop:%d, k:%d, open_t = %f, def_t =%f, write_t = %f sec,run_t = %f sec\n", sizes[0], sizes[1], sizes[2],mvar_flag, nvars, k_loop, top, new_open_tim[top], new_def_tim[top], new_write_tim[top], new_run_tim[top]);  
    335333    } 
    336334     
  • trunk/test/mcoll_perf/single_mcoll_perf_record.c

    r691 r694  
    4949    MPI_Offset *bufcount_list; 
    5050    int ndims = 3; 
    51     int nvars = 10; 
     51    int ntimes = 10; 
    5252    int k, k_loop; 
    5353    MPI_Datatype *datatype_list; 
     
    6363    array_of_gsizes[0] = array_of_gsizes[1] = array_of_gsizes[2] = length; 
    6464 
    65     nvars = atoi(argv[2]); 
     65    ntimes = atoi(argv[2]); 
    6666    k_loop = atoi(argv[3]); 
    6767    mvar_flag = atoi(argv[4]); 
     
    105105    order = MPI_ORDER_C; 
    106106     
    107     buf = (int **)malloc(nvars*sizeof(int*)); 
     107    buf = (int **)malloc(ntimes*sizeof(int*)); 
    108108    if (buf == NULL){ 
    109109                printf("buf malloc error\n"); 
    110110                return 0;                
    111111    }    
    112     varid = (int *)malloc(nvars*sizeof(int)); 
     112    varid = (int *)malloc(ntimes*sizeof(int)); 
    113113    if (varid == NULL){ 
    114114                printf("varid malloc error\n"); 
    115115                return 0;                
    116116    }    
    117     bufcount_list = (MPI_Offset *)malloc(nvars*sizeof(MPI_Offset)); 
     117    bufcount_list = (MPI_Offset *)malloc(ntimes*sizeof(MPI_Offset)); 
    118118    if (bufcount_list == NULL){ 
    119119                printf("bufcount_list malloc error\n"); 
    120120                return 0;                
    121121    }    
    122     starts_list = (MPI_Offset **)malloc(nvars*sizeof(MPI_Offset *)); 
     122    starts_list = (MPI_Offset **)malloc(ntimes*sizeof(MPI_Offset *)); 
    123123    if (starts_list== NULL){ 
    124124                printf("starts_list malloc error\n"); 
    125125                return 0;                
    126126    }    
    127     count_list = (MPI_Offset **)malloc(nvars*sizeof(MPI_Offset *)); 
     127    count_list = (MPI_Offset **)malloc(ntimes*sizeof(MPI_Offset *)); 
    128128    if (count_list == NULL){ 
    129129                printf("count_list malloc error\n"); 
    130130                return 0;                
    131131    }    
    132     datatype_list = (MPI_Datatype*)malloc(nvars*sizeof(MPI_Datatype)); 
     132    datatype_list = (MPI_Datatype*)malloc(ntimes*sizeof(MPI_Datatype)); 
    133133    if (datatype_list == NULL){ 
    134134                printf("count_list malloc error\n"); 
     
    136136    }    
    137137     
    138     array_of_requests = (NCMPI_Request *)malloc(nvars*sizeof(struct NCMPI_Req)); 
     138    array_of_requests = (NCMPI_Request *)malloc(ntimes*sizeof(struct NCMPI_Req)); 
    139139     
    140140    new_open_tim = (double *)malloc(k_loop*sizeof(double)); 
     
    159159    }    
    160160  
    161     for (i=0; i<nvars; i++) { 
     161    for (i=0; i<ntimes; i++) { 
    162162       starts_list[i] = (MPI_Offset *)malloc(ndims*sizeof(MPI_Offset)); 
    163163       if (starts_list[i] == NULL){ 
     
    203203 
    204204    /* mput */ 
    205     for (i=0; i<nvars; i++) { 
     205    for (i=0; i<ntimes; i++) { 
    206206           starts_list[i][0] = array_of_starts[0]+i*array_of_gsizes[0]; 
    207207           count_list[i][0]  = length; 
     
    215215 
    216216    srand(mynod+1); 
    217     for(i=0; i<nvars;i++){ 
     217    for(i=0; i<ntimes;i++){ 
    218218        buf[i] = (int *) malloc(bufcount * sizeof(int)); 
    219219        if (buf[i] == NULL){ 
     
    234234 
    235235    for (k=0; k<k_loop; k++){ 
    236       sprintf(filename, "%s.%d.%d.%d.%d.nc", pathname, length, nvars, mvar_flag, k); 
     236      sprintf(filename, "%s.%d.%d.%d.%d.nc", pathname, length, ntimes, mvar_flag, k); 
    237237      MPI_Barrier(MPI_COMM_WORLD); 
    238238      start_time = MPI_Wtime(); 
     
    250250        sprintf(varname, "var_%d", 0); 
    251251        ncmpi_def_var(ncid, varname, NC_INT, ndims, dimids, &varid[0]); 
    252       for (i=1; i<nvars; i++){ 
     252      for (i=1; i<ntimes; i++){ 
    253253        varid[i]=varid[0]; 
    254254      } 
     
    264264   them */ 
    265265        if (mvar_flag == 0) { 
    266               for (i=0; i<nvars; i++){ 
     266              for (i=0; i<ntimes; i++){ 
    267267                  status = ncmpi_put_vara_all(ncid, varid[i], 
    268268                            starts_list[i], count_list[i], 
     
    272272        }  
    273273        if (mvar_flag == 1) { 
    274 //                   status = ncmpi_put_mvara_all(ncid, nvars, varid, 
    275              status = ncmpi_put_mvara_all(ncid, nvars, varid, 
     274//                   status = ncmpi_put_mvara_all(ncid, ntimes, varid, 
     275             status = ncmpi_put_mvara_all(ncid, ntimes, varid, 
    276276                                starts_list, count_list, 
    277277                               (void **)buf, bufcount_list, datatype_list); 
     
    279279        } 
    280280        if (mvar_flag == 2) { 
    281               for (i=0; i<nvars; i++){ 
     281              for (i=0; i<ntimes; i++){ 
    282282                  status = ncmpi_iput_vara_all(ncid, varid[i], 
    283283                            starts_list[i], count_list[i], 
     
    288288        }  
    289289        if (mvar_flag == 3) { 
    290               for (i=0; i<nvars; i++){ 
     290              for (i=0; i<ntimes; i++){ 
    291291                  status = ncmpi_iput_vara_all(ncid, varid[i], 
    292292                            starts_list[i], count_list[i], 
     
    294294                  TEST_HANDLE_ERR(status); 
    295295              } 
    296               ncmpi_waitall(nvars, array_of_requests); 
     296              ncmpi_waitall(ntimes, array_of_requests); 
    297297        }  
    298298  
     
    321321      } 
    322322 
    323       file_size = 1024+nvars*array_of_gsizes[0]*array_of_gsizes[1]*array_of_gsizes[2]*sizeof(int); 
    324       write_bw = file_size/new_run_tim[top]/1024.0/1024.0; 
    325       fprintf(stderr, "mvar nvars:%d, Global array size %d x %d x %d integers, local array size: %d x %d x%d, filesize:%d\n", nvars, array_of_gsizes[0], array_of_gsizes[1], array_of_gsizes[2],sizes[0], sizes[1], sizes[2], file_size); 
    326       fprintf(stderr, "%dx%dx%d, %d: nvars:%d, loop:%d, k:%d, open_t = %f, def_t =%f, write_t = %f sec,run_t = %f sec, filesize: %ld, bandwidth = %f Mbytes/sec\n", sizes[0], sizes[1], sizes[2],mvar_flag, nvars, k_loop, top, new_open_tim[top], new_def_tim[top], new_write_tim[top], new_run_tim[top],file_size, write_bw);  
    327     } 
    328      
     323      fprintf(stderr, "one record variable ntimes:%d, Global array size (%d x %d) x %d x %d integers, local array size: %d x %d x%d, filesize:%d\n", ntimes, array_of_gsizes[0], ntimes, array_of_gsizes[1], array_of_gsizes[2],sizes[0], sizes[1], sizes[2], file_size); 
     324      fprintf(stderr, "%dx%dx%d, %d: ntimes:%d, loop:%d, k:%d, open_t = %f, def_t =%f, write_t = %f sec,run_t = %f sec\n", sizes[0], sizes[1], sizes[2],mvar_flag, ntimes, k_loop, top, new_open_tim[top], new_def_tim[top], new_write_tim[top], new_run_tim[top]);  
     325    } 
     326     
     327 
    329328/* 
    330329    int nkeys;  
     
    353352    free(new_run_tim); 
    354353 
    355     for (i=0; i<nvars; i++){ 
     354    for (i=0; i<ntimes; i++){ 
    356355    free(buf[i]); 
    357356    free(starts_list[i]);