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_remap_omp.f90

    r1608 r1665  
    4141  DOUBLE PRECISION, PARAMETER :: missing_value = 100000 
    4242  INTEGER :: provided 
     43   
     44  integer :: num_args, ix, nb_servers 
     45  character(len=12), dimension(:), allocatable :: args 
     46 
     47  num_args = command_argument_count() 
     48  if(num_args<1) then 
     49    print*, "please give the number of servers as argument." 
     50    call abort 
     51  endif 
     52 
     53  allocate(args(num_args))  ! I've omitted checking the return status of the allocation  
     54 
     55  do ix = 1, num_args 
     56    call get_command_argument(ix,args(ix)) 
     57    ! now parse the argument as you wish 
     58  end do 
     59 
     60  READ(args(1),*) nb_servers 
    4361 
    4462  CALL MPI_INIT_THREAD(3, provided, ierr) 
     
    5169  CALL MPI_COMM_RANK(MPI_COMM_WORLD,rank,ierr) 
    5270  CALL MPI_COMM_SIZE(MPI_COMM_WORLD,size,ierr) 
    53   if(rank < size-2) then 
     71  if(rank < size-nb_servers) then 
    5472  
    5573  !$omp parallel default(firstprivate)  
Note: See TracChangeset for help on using the changeset viewer.