Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
test_h5
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
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
Thomas Hayward-Schneider
test_h5
Commits
51aab498
Commit
51aab498
authored
11 months ago
by
Thomas Hayward-Schneider
Browse files
Options
Downloads
Patches
Plain Diff
allow npart to be set from outside. Allow Independent HDF5 IO
parent
0daaf33f
No related branches found
No related tags found
No related merge requests found
Pipeline
#213804
passed
11 months ago
Stage: compile
Stage: run
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test_h5.F90
+29
-2
29 additions, 2 deletions
test_h5.F90
with
29 additions
and
2 deletions
test_h5.F90
+
29
−
2
View file @
51aab498
...
...
@@ -13,6 +13,15 @@ module test_h5_mod
character
(
len
=
80
)
::
fname_f90
character
(
len
=*
),
parameter
::
rfformstring
=
'(a,i4.4)'
! From Beliavsky, https://fortran-lang.discourse.group/t/speed-of-atoi-and-atof-vs-internal-read/3375
interface
function
atoi
(
in
)
bind
(
c
)
use
,
intrinsic
::
iso_c_binding
integer
(
c_int
)
::
atoi
character
(
c_char
)
::
in
(
*
)
end
function
end
interface
contains
subroutine
test_write
...
...
@@ -102,7 +111,12 @@ module test_h5_mod
call
h5screate_simple_f
(
1
,
count_p
,
memspace_p
,
error
)
call
h5screate_simple_f
(
1
,
dimsf_p
,
filespace_p
,
error
)
call
h5pcreate_f
(
H5P_DATASET_XFER_F
,
wlist_id
,
error
)
#ifdef H5_INDEPENDENT
if
(
me_world
==
0
)
print
*
,
"independent IO"
call
h5pset_dxpl_mpio_f
(
wlist_id
,
H5FD_MPIO_INDEPENDENT_F
,
error
)
#else
call
h5pset_dxpl_mpio_f
(
wlist_id
,
H5FD_MPIO_COLLECTIVE_F
,
error
)
#endif
call
h5dcreate_f
(
file_id
,
"npart"
,
H5T_NATIVE_INTEGER
,
filespace_p
,
dset_id
(
nfields
),
error
)
call
h5sselect_hyperslab_f
(
filespace_p
,
H5S_SELECT_SET_F
,
start_p
,
count_p
,
error
,
stride_p
,
block_p
)
call
h5dwrite_f
(
dset_id
(
nfields
),
H5T_NATIVE_INTEGER
,
(/
npart
/),
dimsf_p
,
&
...
...
@@ -371,9 +385,22 @@ module test_h5_mod
#endif
end
subroutine
test_read_f90
pure
integer
function
get_npart
(
me_world
,
nranks
)
result
(
npart
)
integer
function
get_npart
(
me_world
,
nranks
)
result
(
npart
)
integer
,
intent
(
in
)
::
me_world
,
nranks
npart
=
1000000
+
me_world
-
nranks
/
2
integer
::
env_status
,
env_length
integer
::
npart_base
=
1000000
!! allow npart to be overridden by environment variable
call
get_environment_variable
(
"NPART"
,
length
=
env_length
,
status
=
env_status
)
if
(
env_status
==
0
)
then
block
character
(
len
=
env_length
)
::
npart_str
call
get_environment_variable
(
"NPART"
,
value
=
npart_str
,
status
=
env_status
)
npart_base
=
atoi
(
npart_str
)
end
block
end
if
npart
=
npart_base
+
me_world
-
nranks
/
2
end
function
get_npart
end
module
test_h5_mod
...
...
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