Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
ParallelPrimeSearch
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hailu, Dawit
ParallelPrimeSearch
Commits
b93d5115
Commit
b93d5115
authored
3 years ago
by
Behrens, Prof. Dr. Jörn
Browse files
Options
Downloads
Patches
Plain Diff
initial commit of HelloMP
parent
aff2781d
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitignore
+5
-0
5 additions, 0 deletions
.gitignore
Hello.c
+33
-0
33 additions, 0 deletions
Hello.c
Makefile
+33
-0
33 additions, 0 deletions
Makefile
README.md
+40
-1
40 additions, 1 deletion
README.md
with
111 additions
and
1 deletion
.gitignore
0 → 100644
+
5
−
0
View file @
b93d5115
# compilation residuals
*.o
# main file
Hello
This diff is collapsed.
Click to expand it.
Hello.c
0 → 100644
+
33
−
0
View file @
b93d5115
/*****************************************************************
NAME:
Hello
Description:
this is about the simplest program thinkable to demonstrate
parallel execution with OpenMP
VERSION(S):
1. original version j. behrens 6/2021
*****************************************************************/
#include
<stdio.h>
#include
<omp.h>
int
main
(
int
argc
,
char
**
argv
)
{
/* local declarations */
int
thrd_id
;
/* this is the main print statement parallelized! */
#pragma omp parallel private(thrd_id)
{
thrd_id
=
omp_get_thread_num
();
printf
(
"Hello from process Number %d
\n
"
,
thrd_id
);
}
return
0
;
}
/* end of main */
This diff is collapsed.
Click to expand it.
Makefile
0 → 100644
+
33
−
0
View file @
b93d5115
# sample makefile for the C PPTemplate
# j. behrens 06/2021
CC
=
gcc
#
# THIS OPTION IS FOR THE DATA PARALLEL VERSION (-mp)
CCFLAGS
=
-fopenmp
-I
/opt/local/include
DATLIBS
=
-lgomp
-lm
OBJECTS
=
\
Hello.o
# default make
all
::
@
make Hello
@
make clear
# make object files
.c.o
:
${
CC
}
${
CCFLAGS
}
-c
$<
# make target (executable)
Hello
:
${OBJECTS}
${
CC
}
${
CCFLAGS
}
-o
$@
${
OBJECTS
}
${
LIBS
}
clear
::
@
rm
*
.o
This diff is collapsed.
Click to expand it.
README.md
+
40
−
1
View file @
b93d5115
# HelloMP
\ No newline at end of file
# HelloMP
Yet another Hello World Program
## Description and Purpose
This O(1)-line code demonstrates parallelization with OpenMP
## Contents of this Project
```
README - this file
Makefile - Makefile tested for macOS
Hello.c - parallelized "Hello World" C-program
```
## What do do here
**First**
, build the executable by typing
```
%> make
```
If this fails, you have to adjust your path and settings, however,
I don't know how...
**Second**
, set up the number of threads (e.g. to four)
```
%> export OMP_NUM_THREADS=4
```
**Third**
, run the program
```
%> Hello
```
(c) 2021, Jörn Behrens (joern.behrens@uni-hamburg.de)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment