Changeset 38d77eb for main_bgl_p.f


Ignore:
Timestamp:
11/19/09 11:29:48 (14 years ago)
Author:
baerbaer <baerbaer@…>
Branches:
master
Children:
7137e5d
Parents:
32289cd
Message:

Redirected standard out to logString.

SMMP produced a lot of log messages. This became an issue when run in massively
parallel environments. I replaced all writes to standard out to a write to logString.
The next step is to pass this string to a function that writes the messages to a log
file according to their importance and the chosen log level.

git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/smmp/trunk@34 26dc1dd8-5c4e-0410-9ffe-d298b4865968

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main_bgl_p.f

    r32289cd r38d77eb  
    5757      call mpi_init(ierr)
    5858!       call pmi_cart_comm_create(comm_cart,ierr)
    59       write(*,*) "Initialized MPI. Now setting up communicators."
     59      write (logString, *) "Initialized MPI. Now setting up communicators."
    6060      call flush(6)
    6161      ndims = 4
     
    8181      call MPI_Cart_GET(comm_cart, ndims, dims, periods, coords, ierr)
    8282
    83       write(*,*) ndims, dims, periods, coords
     83      write (logString, *) ndims, dims, periods, coords
    8484      call flush(6)
    8585!       call VTSetup()
     
    192192     &      + (coords(3)/ldims(3))*nblock(1)*nblock(2)
    193193
    194       write(*,*) myrank, color, ldims, nblock
     194      write (logString, *) myrank, color, ldims, nblock
    195195
    196196      call mpi_comm_split(comm_cart,color,myrank,local_comm,ierr)
     
    216216!          call mpi_group_range_incl(group_world, 1, proc_range, group(i)
    217217!      &                              ,error)
    218 !          write (*,*) "Assigning rank ", j, proc_range,
     218!          write (logString, *) "Assigning rank ", j, proc_range,
    219219!      &               "to group", group(i)
    220220!          call flush(6)
     
    227227!              my_mpi_comm = comm(i)
    228228!              rep_id = i - 1
    229 !              write (*,*) rep_id, "has comm", my_mpi_comm
     229!              write (logString, *) rep_id, "has comm", my_mpi_comm
    230230!              call flush(6)
    231231!          endif
     
    233233!
    234234! c     Setup the communicator used for parallel tempering
    235 !       write (*,*) "PTGroup=", ranks(:num_replica)
     235!       write (logString, *) "PTGroup=", ranks(:num_replica)
    236236!       call flush(6)
    237237!       call mpi_group_incl(group_world, num_replica, ranks, group_partem,
     
    241241!
    242242!       if (partem_comm.ne.MPI_COMM_NULL) then
    243 !          write (*,*) partem_comm,myrank, "is master for ", rep_id, "."
     243!          write (logString, *) partem_comm,myrank, "is master for ", rep_id, "."
    244244!       endif
    245245
     
    247247      call mpi_comm_size(my_mpi_comm,no,ierr)
    248248      rep_id = color
    249       write (*,*) "My new rank is ", myrank, "of", no
     249      write (logString, *) "My new rank is ", myrank, "of", no
    250250      call flush(6)
    251251      if (myrank.eq.0) then
    252252         color = 1
    253          write (*,*) 'My rank and color:', myrank, color
     253         write (logString, *) 'My rank and color:', myrank, color
    254254         call flush(6)
    255255      else
     
    258258      call mpi_comm_split(comm_cart,color,0,partem_comm,ierr)
    259259
    260 !       write(*,*) "Finalizing MPI."
     260!       write (logString, *) "Finalizing MPI."
    261261!       call flush(6)
    262262!       CALL mpi_finalize(ierr)
     
    295295
    296296!     ========================================  start of parallel tempering run
    297       write (*,*) "There are ", no,
     297      write (logString, *) "There are ", no,
    298298     &            " processors available for ",rep_id
    299299      call flush(6)
     
    309309
    310310      if(my_pt_rank.eq.0) then
    311          write(*,*) "time for simulation using ", num_proc,
     311         write (logString, *) "time for simulation using ", num_proc,
    312312     &        " processors =",  endwtime - startwtime, " seconds"
    313313         call flush(6)
Note: See TracChangeset for help on using the changeset viewer.