Ignore:
Timestamp:
05/20/19 13:14:51 (5 years ago)
Author:
yushan
Message:

MARK: branch merged with trunk @1660. Add option --omp to enable multithreading.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_trunk_omp/src/test/test_omp.f90

    r1646 r1665  
    3333  INTEGER :: i,j,l,ts,n, provided 
    3434 
     35  integer :: num_args, ix, nb_servers 
     36  character(len=12), dimension(:), allocatable :: args 
     37 
     38  num_args = command_argument_count() 
     39  if(num_args<1) then 
     40    print*, "please give the number of servers as input argument." 
     41    call abort 
     42  endif 
     43 
     44  allocate(args(num_args))  ! I've omitted checking the return status of the allocation  
     45 
     46  do ix = 1, num_args 
     47    call get_command_argument(ix,args(ix)) 
     48    ! now parse the argument as you wish 
     49  end do 
     50 
     51  READ(args(1),*) nb_servers 
     52 
    3553!!! MPI Initialization    
    3654 
     
    4563    CALL MPI_COMM_RANK(MPI_COMM_WORLD,rank,ierr) 
    4664    CALL MPI_COMM_SIZE(MPI_COMM_WORLD,size,ierr) 
    47     if(rank < size-4) then 
     65    if(rank < size-nb_servers) then 
    4866 
    4967    !$omp parallel default(firstprivate) 
Note: See TracChangeset for help on using the changeset viewer.