Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Purpose:

Example of using parallel HDF5 libraries on the cluster. The specific example creates a random vector of dimension 1000 and writes it to a HDF5 (.h5) file in parallel.

Contents:

  • parallel_hdf5.f90: Fortran 90 source file
  • Makefile: Makefile to compile the source code
  • run.sbatch: Batch-job submission script to send the job to the queue

Example Usage:

Commands to load necessary modules (module load), compile the code (make), and submit the job (sbatch):

module load intel/21.2.0-fasrc01 openmpi/4.1.1-fasrc01 hdf5/1.12.1-fasrc01
make
sbatch run.sbatch

Example Batch-Job Submission Script:

#!/bin/bash
#SBATCH -J parallel_hdf5 # job name
#SBATCH -o parallel_hdf5.out # name of standard output file
#SBATCH -e parallel_hdf5.err # name of standard error file
#SBATCH -p test # partition
#SBATCH -t 00:10:00 # time in HH:MM:SS
#SBATCH --nodes=2 # number of nodes
#SBATCH --ntasks=8 # number of total tasks
#SBATCH --mem=4000 # memory
# Load required modules
module load intel/21.2.0-fasrc01 openmpi/4.1.1-fasrc01 hdf5/1.12.1-fasrc01
# Run program
srun -n $SLURM_NTASKS -N $SLURM_NNODES --mpi=pmix ./parallel_hdf5.x

Example Output:

[pkrastev@regal05 Example1]$ h5dump pset_1d.h5 
HDF5 "pset_1d.h5" {
GROUP "/" {
   DATASET "DoubleArray" {
      DATATYPE  H5T_IEEE_F64LE
      DATASPACE  SIMPLE { ( 1000 ) / ( 1000 ) }
      DATA {
      (0): 0.19997, 0.141935, 0.9609, 0.557535, 0.638827, 0.462287, 0.498032,
      (7): 0.867238, 0.762328, 0.23642, 0.0605957, 0.150953, 0.948071,
      (13): 0.844535, 0.181702, 0.280175, 0.229308, 0.552097, 0.73992,
      (19): 0.331059, 0.388762, 0.41635, 0.325443, 0.412334, 0.631472,
      (25): 0.890654, 0.765588, 0.144551, 0.148686, 0.0065211, 0.367894,
      (31): 0.152968, 0.220681, 0.629017, 0.459204, 0.697648, 0.389048,
      (37): 0.919453, 0.199217, 0.58728, 0.363542, 0.754135, 0.194908,
      (43): 0.815831, 0.938569, 0.42343, 0.296155, 0.811725, 0.364881,
      (49): 0.893735, 0.00850734, 0.887926, 0.194576, 0.588769, 0.0942312,
      (55): 0.0470023, 0.921254, 0.331883, 0.0983307, 0.941179, 0.0732383,
      (61): 0.578579, 0.668021, 0.175048, 0.872878, 0.306461, 0.956044,
      (67): 0.13224, 0.905966, 0.758271, 0.98402, 0.417583, 0.187216,
      (73): 0.846184, 0.322552, 0.500836, 0.221774, 0.736674, 0.318103,
      (79): 0.584469, 0.9694, 0.433704, 0.0462207, 0.207506, 0.933283,
      (85): 0.789315, 0.484947, 0.045633, 0.756139, 0.152743, 0.741604,
      (91): 0.256809, 0.0134879, 0.440945, 0.603259, 0.94596, 0.566918,
      (97): 0.348724, 0.493279, 0.437733, 0.201657, 0.559481, 0.493622,
      (103): 0.780411, 0.924335, 0.574803, 0.841705, 0.98707, 0.655486,
      (109): 0.304916, 0.562055, 0.875621, 0.575744, 0.945588, 0.199575,
      (115): 0.81643, 0.565091, 0.227075, 0.571788, 0.926918, 0.739542,
      (121): 0.60732, 0.63896, 0.468232, 0.556615, 0.424539, 0.923961,
      (127): 0.406805, 0.921849, 0.747749, 0.659131, 0.234704, 0.0811879,
      (133): 0.0131869, 0.0224142, 0.0937791, 0.85796, 0.100633, 0.00793147,
      (139): 0.116853, 0.224224, 0.257872, 0.473845, 0.82922, 0.413201,
      (145): 0.134284, 0.617848, 0.545256, 0.884331, 0.17872, 0.0219987,
      (151): 0.160113, 0.426875, 0.745531, 0.778603, 0.966953, 0.478293,
      (157): 0.480435, 0.757997, 0.830556, 0.716843, 0.741072, 0.979138,
      (163): 0.538633, 0.0806921, 0.304183, 0.401776, 0.746524, 0.532387,
      (169): 0.0652913, 0.198581, 0.0198354, 0.342745, 0.393068, 0.90492,
      (175): 0.579429, 0.180445, 0.893429, 0.689629, 0.589662, 0.946246,
      (181): 0.443526, 0.648808, 0.0912926, 0.0309056, 0.918058, 0.255566,
      (187): 0.542555, 0.932495, 0.718231, 0.692003, 0.111436, 0.568246,
      (193): 0.94264, 0.918272, 0.204389, 0.915127, 0.0807761, 0.924301,
      (199): 0.833772, 0.953839, 0.724419, 0.855626, 0.294668, 0.232474,
      (205): 0.578473, 0.511305, 0.335583, 0.714625, 0.860544, 0.711387,
      (211): 0.935738, 0.54794, 0.0397663, 0.138554, 0.605407, 0.172826,
      (217): 0.0364979, 0.620361, 0.876303, 0.389057, 0.321, 0.822223,
      (223): 0.698615, 0.111453, 0.474162, 0.164209, 0.0480765, 0.160595,
      (229): 0.326446, 0.0681234, 0.844862, 0.178804, 0.829085, 0.878276,
      (235): 0.0105085, 0.895585, 0.609042, 0.952739, 0.425498, 0.745232,
      (241): 0.219068, 0.922195, 0.0561915, 0.329174, 0.371003, 0.289212,
      (247): 0.869631, 0.831188, 0.44411, 0.0401795, 0.86705, 0.920181,
      (253): 0.597854, 0.765649, 0.108976, 0.545615, 0.026541, 0.416392,
      (259): 0.221965, 0.682888, 0.902264, 0.382844, 0.289127, 0.115312,
      (265): 0.492319, 0.013543, 0.491749, 0.710592, 0.767551, 0.316195,
      (271): 0.303195, 0.20531, 0.17625, 0.836124, 0.522006, 0.400819,
      (277): 0.224369, 0.932966, 0.0024763, 0.928547, 0.137668, 0.631684,
      (283): 0.938629, 0.643558, 0.16586, 0.462019, 0.889677, 0.713773,
      (289): 0.385957, 0.996965, 0.403836, 0.89845, 0.185188, 0.109304,
      (295): 0.442038, 0.0137578, 0.745944, 0.220068, 0.807168, 0.970184,
      (301): 0.0648431, 0.936665, 0.828711, 0.515563, 0.902511, 0.235366,
      (307): 0.981552, 0.954296, 0.599789, 0.646957, 0.655938, 0.312768,
      (313): 0.0304353, 0.225, 0.279052, 0.00381425, 0.197655, 0.179823,
      (319): 0.673274, 0.478561, 0.267599, 0.271681, 0.903424, 0.797367,
      (325): 0.251352, 0.36653, 0.376599, 0.660687, 0.933613, 0.28664,
      (331): 0.419267, 0.270074, 0.333177, 0.355519, 0.272609, 0.8249,
      (337): 0.601249, 0.71363, 0.364507, 0.162045, 0.264363, 0.709854,
      (343): 0.0404988, 0.907396, 0.729367, 0.132155, 0.995026, 0.387821,
      (349): 0.857952, 0.0755082, 0.637159, 0.0852568, 0.286455, 0.520528,
      (355): 0.550917, 0.794769, 0.603488, 0.473192, 0.242954, 0.0776111,
      (361): 0.634118, 0.267922, 0.589789, 0.437744, 0.382594, 0.946084,
      (367): 0.272269, 0.123039, 0.495633, 0.146897, 0.00878857, 0.809834,
      (373): 0.321872, 0.597766, 0.841402, 0.182342, 0.985226, 0.382896,
      (379): 0.24645, 0.456582, 0.763042, 0.903406, 0.417734, 0.856001,
      (385): 0.652522, 0.151344, 0.680285, 0.895433, 0.972925, 0.326525,
      (391): 0.552631, 0.47821, 0.217996, 0.21761, 0.153257, 0.454529,
      (397): 0.387982, 0.442733, 0.0659948, 0.547025, 0.146929, 0.61213,
      (403): 0.141371, 0.40137, 0.312466, 0.733753, 0.667523, 0.430454,
      (409): 0.868006, 0.399573, 0.114485, 0.708054, 0.500267, 0.916429,
      (415): 0.52498, 0.155908, 0.049926, 0.372179, 0.284487, 0.928065,
      (421): 0.558102, 0.829536, 0.0570441, 0.948608, 0.999968, 0.396658,
      (427): 0.668463, 0.920502, 0.2853, 0.107649, 0.514819, 0.554773,
      (433): 0.514889, 0.846877, 0.342097, 0.0549875, 0.403139, 0.501305,
      (439): 0.331021, 0.496615, 0.101418, 0.308106, 0.610946, 0.0448601,
      (445): 0.768423, 0.723094, 0.421166, 0.269388, 0.217641, 0.756598,
      (451): 0.786066, 0.46748, 0.157433, 0.958346, 0.0322059, 0.592156,
      (457): 0.0972408, 0.294494, 0.0592722, 0.257479, 0.330613, 0.166219,
      (463): 0.0994324, 0.371392, 0.298155, 0.806379, 0.0971079, 0.455407,
      (469): 0.148006, 0.801886, 0.734742, 0.780538, 0.154538, 0.527889,
      (475): 0.141999, 0.0906219, 0.672103, 0.0986985, 0.916402, 0.407812,
      (481): 0.299418, 0.373969, 0.86123, 0.0278207, 0.777036, 0.3486,
      (487): 0.45534, 0.143498, 0.548722, 0.535718, 0.95788, 0.947732,
      (493): 0.353298, 0.529135, 0.761873, 0.32088, 0.153568, 0.0830575,
      (499): 0.902861, 0.677801, 0.050991, 0.322467, 0.352986, 0.809829,
      (505): 0.457181, 0.412096, 0.60625, 0.129612, 0.18131, 0.683606,
      (511): 0.136816, 0.953743, 0.745772, 0.523554, 0.299599, 0.382882,
      (517): 0.81292, 0.570297, 0.609519, 0.977274, 0.652812, 0.0140504,
      (523): 0.552546, 0.470205, 0.750895, 0.412274, 0.427552, 0.344709,
      (529): 0.0707082, 0.729903, 0.484372, 0.542491, 0.917389, 0.232797,
      (535): 0.270997, 0.345675, 0.628197, 0.337676, 0.728221, 0.394154,
      (541): 0.53568, 0.885043, 0.533979, 0.571448, 0.882907, 0.943829,
      (547): 0.395185, 0.883093, 0.778241, 0.349599, 0.893328, 0.808859,
      (553): 0.0123494, 0.172958, 0.193429, 0.5085, 0.405079, 0.120189,
      (559): 0.538832, 0.111506, 0.783899, 0.268575, 0.401391, 0.787156,
      (565): 0.147926, 0.251772, 0.419764, 0.174324, 0.640648, 0.35577,
      (571): 0.987696, 0.929827, 0.792056, 0.25992, 0.0839463, 0.843952,
      (577): 0.00170102, 0.379588, 0.276776, 0.242395, 0.00719544, 0.307363,
      (583): 0.805876, 0.959202, 0.946004, 0.215797, 0.1411, 0.130233,
      (589): 0.0848711, 0.0192242, 0.925911, 0.453873, 0.697028, 0.372451,
      (595): 0.406458, 0.605853, 0.0929871, 0.27406, 0.487501, 0.0389541,
      (601): 0.942128, 0.0155972, 0.606317, 0.535846, 0.342403, 0.585965,
      (607): 0.0029828, 0.0531472, 0.226955, 0.977632, 0.3674, 0.274846,
      (613): 0.0353179, 0.519608, 0.185595, 0.330026, 0.571546, 0.0289397,
      (619): 0.380698, 0.542072, 0.158785, 0.145704, 0.686823, 0.601693,
      (625): 0.413642, 0.972099, 0.32351, 0.25621, 0.917516, 0.497981,
      (631): 0.84097, 0.948554, 0.152634, 0.299144, 0.874995, 0.73235,
      (637): 0.272045, 0.286268, 0.773607, 0.615977, 0.644251, 0.11216,
      (643): 0.749535, 0.542799, 0.860439, 0.780207, 0.76705, 0.0953348,
      (649): 0.958809, 0.434359, 0.282344, 0.836777, 0.356543, 0.98952,
      (655): 0.197984, 0.993574, 0.862964, 0.307174, 0.660851, 0.610054,
      (661): 0.31392, 0.716715, 0.27954, 0.610977, 0.333382, 0.25524,
      (667): 0.525311, 0.492519, 0.659169, 0.405388, 0.562976, 0.476212,
      (673): 0.0701305, 0.946339, 0.259729, 0.322008, 0.789161, 0.697303,
      (679): 0.403709, 0.420068, 0.109135, 0.0163361, 0.595359, 0.307463,
      (685): 0.184062, 0.124255, 0.669014, 0.541656, 0.965762, 0.619755,
      (691): 0.207039, 0.779526, 0.627099, 0.368219, 0.0530014, 0.168039,
      (697): 0.0420299, 0.803196, 0.28307, 0.53843, 0.991046, 0.0697475,
      (703): 0.691626, 0.538742, 0.325223, 0.266007, 0.241418, 0.0490804,
      (709): 0.805458, 0.0737296, 0.32456, 0.321307, 0.341412, 0.0410958,
      (715): 0.403015, 0.534393, 0.0896161, 0.911321, 0.557976, 0.165343,
      (721): 0.21321, 0.722115, 0.209449, 0.120739, 0.414342, 0.493228,
      (727): 0.784586, 0.531389, 0.621116, 0.993721, 0.0805905, 0.740081,
      (733): 0.891845, 0.329979, 0.0955071, 0.787828, 0.674924, 0.554263,
      (739): 0.904447, 0.649668, 0.0346388, 0.757693, 0.983681, 0.800419,
      (745): 0.406546, 0.484924, 0.570077, 0.50636, 0.953877, 0.559773,
      (751): 0.383453, 0.510641, 0.18208, 0.289348, 0.45784, 0.250965,
      (757): 0.177903, 0.361647, 0.443235, 0.537395, 0.591083, 0.687155,
      (763): 0.144633, 0.15579, 0.0390908, 0.566867, 0.337627, 0.540992,
      (769): 0.63455, 0.918092, 0.964317, 0.583256, 0.957444, 0.998203,
      (775): 0.781889, 0.702569, 0.540035, 0.920101, 0.662899, 0.163377,
      (781): 0.315325, 0.422939, 0.0881542, 0.0837203, 0.402638, 0.393436,
      (787): 0.595448, 0.736055, 0.290889, 0.52864, 0.450202, 0.133932,
      (793): 0.919713, 0.986356, 0.685351, 0.451382, 0.800249, 0.985478,
      (799): 0.0185301, 0.703977, 0.944889, 0.649975, 0.843461, 0.7905,
      (805): 0.244448, 0.960514, 0.422487, 0.0983601, 0.88671, 0.064404,
      (811): 0.655518, 0.441848, 0.070758, 0.914595, 0.0871935, 0.457151,
      (817): 0.767442, 0.158277, 0.470438, 0.587708, 0.766618, 0.352149,
      (823): 0.522462, 0.930573, 0.973203, 0.314341, 0.739796, 0.166944,
      (829): 0.753755, 0.821375, 0.280082, 0.441675, 0.0333913, 0.598495,
      (835): 0.50786, 0.873477, 0.352181, 0.173559, 0.996527, 0.945488,
      (841): 0.625994, 0.43717, 0.265617, 0.70318, 0.762021, 0.098053,
      (847): 0.61147, 0.98914, 0.0131529, 0.37101, 0.711587, 0.633305,
      (853): 0.231723, 0.197155, 0.423895, 0.503214, 0.616584, 0.244966,
      (859): 0.28264, 0.37097, 0.608333, 0.248928, 0.101833, 0.941222,
      (865): 0.43841, 0.218347, 0.176231, 0.367578, 0.152574, 0.989141,
      (871): 0.845681, 0.778302, 0.145124, 0.0994282, 0.876122, 0.133313,
      (877): 0.120426, 0.325307, 0.506678, 0.469988, 0.697757, 0.49483,
      (883): 0.884304, 0.382785, 0.213042, 0.0311541, 0.339841, 0.092169,
      (889): 0.160085, 0.289512, 0.697246, 0.984603, 0.0209855, 0.00738618,
      (895): 0.0998068, 0.847692, 0.292046, 0.166188, 0.827058, 0.628708,
      (901): 0.977627, 0.286163, 0.482462, 0.543164, 0.673253, 0.216756,
      (907): 0.749001, 0.848938, 0.984113, 0.392741, 0.163373, 0.524415,
      (913): 0.0848804, 0.993128, 0.673724, 0.62373, 0.227942, 0.0944471,
      (919): 0.841415, 0.590717, 0.926301, 0.0100431, 0.54052, 0.523866,
      (925): 0.0115136, 0.559518, 0.29584, 0.60196, 0.426175, 0.659365,
      (931): 0.384312, 0.271488, 0.341194, 0.113937, 0.306615, 0.173342,
      (937): 0.40995, 0.891176, 0.709061, 0.589312, 0.803212, 0.245394,
      (943): 0.250753, 0.569368, 0.363211, 0.687203, 0.444084, 0.49712,
      (949): 0.995873, 0.540289, 0.551852, 0.690086, 0.740013, 0.167693,
      (955): 0.244396, 0.706139, 0.944969, 0.368525, 0.236549, 0.499911,
      (961): 0.806807, 0.857825, 0.139877, 0.394801, 0.589529, 0.917979,
      (967): 0.273662, 0.515513, 0.629917, 0.986522, 0.179646, 0.730823,
      (973): 0.0985746, 0.301127, 0.0388652, 0.236215, 0.27003, 0.372827,
      (979): 0.27947, 0.305375, 0.614549, 0.927316, 0.365411, 0.926265,
      (985): 0.852558, 0.526487, 0.131611, 0.946393, 0.524408, 0.388637,
      (991): 0.89968, 0.894437, 0.261259, 0.722539, 0.409665, 0.0723895,
      (997): 0.14682, 0.949627, 0.530503
      }
   }
}
}