Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TurTLE
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TurTLE
TurTLE
Commits
0c8f8f6c
Commit
0c8f8f6c
authored
10 years ago
by
Chichi Lalescu
Browse files
Options
Downloads
Patches
Plain Diff
remove C files
parent
b0c0f80b
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
mpi_file_test.c
+0
-92
0 additions, 92 deletions
mpi_file_test.c
mpi_test.c
+0
-23
0 additions, 23 deletions
mpi_test.c
with
0 additions
and
115 deletions
mpi_file_test.c
deleted
100644 → 0
+
0
−
92
View file @
b0c0f80b
#include
<stdio.h>
#include
<stdlib.h>
#include
<math.h>
#include
<mpi.h>
int
myrank
,
nprocs
;
int
main
(
int
argc
,
char
*
argv
[])
{
/*************************/
// init mpi environment
MPI_Init
(
&
argc
,
&
argv
);
MPI_Comm_rank
(
MPI_COMM_WORLD
,
&
myrank
);
MPI_Comm_size
(
MPI_COMM_WORLD
,
&
nprocs
);
/*************************/
int
sizes
[]
=
{
256
,
256
};
int
subsizes
[]
=
{
sizes
[
1
]
/
nprocs
,
sizes
[
0
]};
int
starts
[]
=
{
myrank
*
sizes
[
1
]
/
nprocs
,
0
};
float
a
[
subsizes
[
1
]][
subsizes
[
0
]];
MPI_Info
info
;
MPI_Info_create
(
&
info
);
MPI_File
file0
,
file1
;
MPI_Status
status
;
MPI_Datatype
col0
;
MPI_Request
req
;
MPI_Type_create_subarray
(
2
,
sizes
,
subsizes
,
starts
,
MPI_ORDER_C
,
MPI_FLOAT
,
&
col0
);
MPI_Type_commit
(
&
col0
);
MPI_File_open
(
MPI_COMM_WORLD
,
"data0"
,
MPI_MODE_RDONLY
,
info
,
&
file0
);
MPI_File_set_view
(
file0
,
0
,
MPI_FLOAT
,
col0
,
"native"
,
info
);
MPI_File_read_all
(
file0
,
(
void
*
)
a
,
subsizes
[
0
]
*
subsizes
[
1
],
MPI_FLOAT
,
MPI_STATUS_IGNORE
);
MPI_File_close
(
&
file0
);
MPI_File_open
(
MPI_COMM_WORLD
,
"data1"
,
MPI_MODE_CREATE
|
MPI_MODE_WRONLY
,
info
,
&
file1
);
MPI_File_set_view
(
file1
,
0
,
MPI_FLOAT
,
col0
,
"native"
,
info
);
MPI_File_write_all
(
file1
,
(
void
*
)
a
,
subsizes
[
0
]
*
subsizes
[
1
],
MPI_FLOAT
,
MPI_STATUS_IGNORE
);
MPI_File_close
(
&
file1
);
printf
(
"%d aloha
\n
"
,
myrank
);
MPI_Type_free
(
&
col0
);
/*************************/
//finalize mpi environment
MPI_Finalize
();
/*************************/
return
EXIT_SUCCESS
;
}
This diff is collapsed.
Click to expand it.
mpi_test.c
deleted
100644 → 0
+
0
−
23
View file @
b0c0f80b
#include
<stdio.h>
#include
<stdlib.h>
#include
<math.h>
#include
<mpi.h>
int
myrank
,
nprocs
;
int
main
(
int
argc
,
char
*
argv
[])
{
/*************************/
// init mpi environment
MPI_Init
(
&
argc
,
&
argv
);
MPI_Comm_size
(
MPI_COMM_WORLD
,
&
nprocs
);
MPI_Comm_rank
(
MPI_COMM_WORLD
,
&
myrank
);
/*************************/
printf
(
"%d %d aloha
\n
"
,
myrank
,
nprocs
);
MPI_Finalize
();
/*************************/
return
EXIT_SUCCESS
;
}
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