add
This commit is contained in:
		
							
								
								
									
										15
									
								
								no_reduction.f90
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								no_reduction.f90
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,15 @@
 | 
				
			|||||||
 | 
					program summ
 | 
				
			||||||
 | 
					implicit none
 | 
				
			||||||
 | 
					    integer :: sum = 0
 | 
				
			||||||
 | 
					    integer :: n
 | 
				
			||||||
 | 
					    !$OMP parallel do
 | 
				
			||||||
 | 
					    do n = 0, 1000
 | 
				
			||||||
 | 
					        sum = sum + n
 | 
				
			||||||
 | 
					        print*, n, " ", sum
 | 
				
			||||||
 | 
					    end do
 | 
				
			||||||
 | 
					    !$OMP end parallel do
 | 
				
			||||||
 | 
					    print*, " "
 | 
				
			||||||
 | 
					    print*, " "
 | 
				
			||||||
 | 
					    print*, " "
 | 
				
			||||||
 | 
					    print*, "hasilnya adalah ", sum
 | 
				
			||||||
 | 
					end program summ
 | 
				
			||||||
							
								
								
									
										12
									
								
								no_reduction.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								no_reduction.sh
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,12 @@
 | 
				
			|||||||
 | 
					#!/bin/bash
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#SBATCH --nodes=1
 | 
				
			||||||
 | 
					#SBATCH --time=00:01:10
 | 
				
			||||||
 | 
					#SBATCH --job-name=Gabriel
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					whoami
 | 
				
			||||||
 | 
					hostname
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					gfortran -fopenmp no_reduction.f90 -o no_reduction.x
 | 
				
			||||||
 | 
					export OMP_NUM_THREADS=4
 | 
				
			||||||
 | 
					./no_reduction.x
 | 
				
			||||||
							
								
								
									
										15
									
								
								with_reduction.f90
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								with_reduction.f90
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,15 @@
 | 
				
			|||||||
 | 
					program summ
 | 
				
			||||||
 | 
					implicit none
 | 
				
			||||||
 | 
					    integer :: sum = 0
 | 
				
			||||||
 | 
					    integer :: n
 | 
				
			||||||
 | 
					    !$OMP parallel do
 | 
				
			||||||
 | 
					    do n = 0, 1000
 | 
				
			||||||
 | 
					        sum = sum + n
 | 
				
			||||||
 | 
					        print*, n, " ", sum
 | 
				
			||||||
 | 
					    end do
 | 
				
			||||||
 | 
					    !$OMP end parallel do
 | 
				
			||||||
 | 
					    print*, " "
 | 
				
			||||||
 | 
					    print*, " "
 | 
				
			||||||
 | 
					    print*, " "
 | 
				
			||||||
 | 
					    print*, "hasilnya adalah ", sum
 | 
				
			||||||
 | 
					end program summ
 | 
				
			||||||
							
								
								
									
										12
									
								
								with_reduction.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								with_reduction.sh
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,12 @@
 | 
				
			|||||||
 | 
					#!/bin/bash
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#SBATCH --nodes=1
 | 
				
			||||||
 | 
					#SBATCH --time=00:01:10
 | 
				
			||||||
 | 
					#SBATCH --job-name=Gabriel
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					whoami
 | 
				
			||||||
 | 
					hostname
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					gfortran -fopenmp with_reduction.f90 -o with_reduction.x
 | 
				
			||||||
 | 
					export OMP_NUM_THREADS=4
 | 
				
			||||||
 | 
					./with_reduction.x
 | 
				
			||||||
		Reference in New Issue
	
	Block a user