@@ -68,8 +68,8 @@ static void _get_aio_latencies(std::vector<std::chrono::duration<double>>& raw_l
6868 std::accumulate (lat_usec.begin (), lat_usec.end (), 0 ) / lat_usec.size ();
6969}
7070
71- static void _do_io_submit_singles (const long long int n_iocbs,
72- const long long int iocb_index,
71+ static void _do_io_submit_singles (const int64_t n_iocbs,
72+ const int64_t iocb_index,
7373 std::unique_ptr<aio_context>& aio_ctxt,
7474 std::vector<std::chrono::duration<double >>& submit_times)
7575{
@@ -89,8 +89,8 @@ static void _do_io_submit_singles(const long long int n_iocbs,
8989 }
9090}
9191
92- static void _do_io_submit_block (const long long int n_iocbs,
93- const long long int iocb_index,
92+ static void _do_io_submit_block (const int64_t n_iocbs,
93+ const int64_t iocb_index,
9494 std::unique_ptr<aio_context>& aio_ctxt,
9595 std::vector<std::chrono::duration<double >>& submit_times)
9696{
@@ -109,18 +109,18 @@ static void _do_io_submit_block(const long long int n_iocbs,
109109 assert (submit_ret > 0 );
110110}
111111
112- static int _do_io_complete (const long long int min_completes,
113- const long long int max_completes,
112+ static int _do_io_complete (const int64_t min_completes,
113+ const int64_t max_completes,
114114 std::unique_ptr<aio_context>& aio_ctxt,
115115 std::vector<std::chrono::duration<double >>& reap_times)
116116{
117117 const auto start_time = std::chrono::high_resolution_clock::now ();
118- long long int n_completes = io_pgetevents (aio_ctxt->_io_ctxt ,
119- min_completes,
120- max_completes,
121- aio_ctxt->_io_events .data (),
122- nullptr ,
123- nullptr );
118+ int64_t n_completes = io_pgetevents (aio_ctxt->_io_ctxt ,
119+ min_completes,
120+ max_completes,
121+ aio_ctxt->_io_events .data (),
122+ nullptr ,
123+ nullptr );
124124 reap_times.push_back (std::chrono::high_resolution_clock::now () - start_time);
125125 assert (n_completes >= min_completes);
126126 return n_completes;
@@ -134,7 +134,7 @@ void do_aio_operation_sequential(const bool read_op,
134134{
135135 struct io_prep_context prep_ctxt (read_op, xfer_ctxt, aio_ctxt->_block_size, &aio_ctxt->_iocbs);
136136
137- const auto num_io_blocks = static_cast <long long int >(
137+ const auto num_io_blocks = static_cast <int64_t >(
138138 ceil (static_cast <double >(xfer_ctxt->_num_bytes ) / aio_ctxt->_block_size ));
139139#if DEBUG_DS_AIO_PERF
140140 const auto io_op_name = std::string (read_op ? " read" : " write" );
@@ -145,15 +145,14 @@ void do_aio_operation_sequential(const bool read_op,
145145 std::vector<std::chrono::duration<double >> submit_times;
146146 std::vector<std::chrono::duration<double >> reap_times;
147147 const auto max_queue_bytes =
148- static_cast <long long int >(aio_ctxt->_queue_depth * aio_ctxt->_block_size );
148+ static_cast <int64_t >(aio_ctxt->_queue_depth * aio_ctxt->_block_size );
149149
150150 auto start = std::chrono::high_resolution_clock::now ();
151- for (long long iocb_index = 0 ; iocb_index < num_io_blocks;
152- iocb_index += aio_ctxt->_queue_depth ) {
151+ for (int64_t iocb_index = 0 ; iocb_index < num_io_blocks; iocb_index += aio_ctxt->_queue_depth ) {
153152 const auto start_offset = iocb_index * aio_ctxt->_block_size ;
154153 const auto start_buffer = (char *)xfer_ctxt->_mem_buffer + start_offset;
155154 const auto n_iocbs =
156- min (static_cast <long long >(aio_ctxt->_queue_depth ), (num_io_blocks - iocb_index));
155+ min (static_cast <int64_t >(aio_ctxt->_queue_depth ), (num_io_blocks - iocb_index));
157156 const auto num_bytes = min (max_queue_bytes, (xfer_ctxt->_num_bytes - start_offset));
158157 prep_ctxt.prep_iocbs (n_iocbs, num_bytes, start_buffer, start_offset);
159158
@@ -285,13 +284,13 @@ int open_file(const char* filename, const bool read_op)
285284
286285int regular_read (const char * filename, std::vector<char >& buffer)
287286{
288- long long int num_bytes;
287+ int64_t num_bytes;
289288 const auto f_size = get_file_size (filename, num_bytes);
290289 assert (f_size != -1 );
291290 buffer.resize (num_bytes);
292291 const auto fd = open (filename, O_RDONLY, 0600 );
293292 assert (fd != -1 );
294- long long int read_bytes = 0 ;
293+ int64_t read_bytes = 0 ;
295294 auto r = 0 ;
296295 do {
297296 const auto buffer_ptr = buffer.data () + read_bytes;
@@ -309,23 +308,23 @@ int regular_read(const char* filename, std::vector<char>& buffer)
309308 return 0 ;
310309}
311310
312- static bool _validate_buffer (const char * filename, void * aio_buffer, const long long int num_bytes)
311+ static bool _validate_buffer (const char * filename, void * aio_buffer, const int64_t num_bytes)
313312{
314313 std::vector<char > regular_buffer;
315314 const auto reg_ret = regular_read (filename, regular_buffer);
316315 assert (0 == reg_ret);
317316 std::cout << " regular read of " << filename << " returned " << regular_buffer.size () << " bytes"
318317 << std::endl;
319318
320- if (static_cast <long long int >(regular_buffer.size ()) != num_bytes) { return false ; }
319+ if (static_cast <int64_t >(regular_buffer.size ()) != num_bytes) { return false ; }
321320
322321 return (0 == memcmp (aio_buffer, regular_buffer.data (), regular_buffer.size ()));
323322}
324323
325324bool validate_aio_operation (const bool read_op,
326325 const char * filename,
327326 void * aio_buffer,
328- const long long int num_bytes)
327+ const int64_t num_bytes)
329328{
330329 const auto msg_suffix = std::string (" deepspeed_aio_" ) +
331330 std::string (read_op ? " read()" : " write()" ) +
0 commit comments