Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added ofi_gettime interfaces to support CLOCK_REALTIME #10050

Merged
merged 1 commit into from
Jun 12, 2024

Conversation

nikhilnanal
Copy link
Contributor

[src/common]: added ofi_get_realtime intefaces to support pthread_cond_timedwait which use CLOCK_REALTIME.In general CLOCK_MONOTONIC is preferred and in use by several providers, therefore new interfaces are added to support the special case of pthread apis.(ref #9614 )

[prov/sockets]: changes made to use ofi_get_realtime instead of ofi_get_time before ofi_wait_cond.

Signed-of-by: Nikhil Nanal nikhil.nanal@intel.com

@nikhilnanal nikhilnanal requested a review from j-xiong May 28, 2024 22:44
Copy link
Contributor

@j-xiong j-xiong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please reformat the commit message so that:
(1) The first line (title line) is not too long (<= 72);
(2) Remove the brackets from [src/common]:, or further shorten it to common: or core:.

Also the prototypes of the new functions need to be added to include/ofi.h.

@@ -303,7 +303,23 @@ uint32_t ofi_generate_seed(void)

return rand_seed;
}
uint64_t ofi_get_realtime_ns(void)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a line before this.

uint64_t ofi_get_realtime_ms(void)
{
return ofi_get_realtime_ns() / 1000000;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a line after this.

@nikhilnanal nikhilnanal force-pushed the clock_monotonic_realtime branch 4 times, most recently from dfdfc3e to 78a7a1b Compare May 29, 2024 21:12
@nikhilnanal nikhilnanal changed the title added ofi_get_realtime intefaces to support pthread_cond_timedwait Added ofi_gettime interfaces to support CLOCK_REALTIME May 29, 2024
@nikhilnanal nikhilnanal force-pushed the clock_monotonic_realtime branch 5 times, most recently from 123e5ca to 854a469 Compare May 29, 2024 21:23
@j-xiong
Copy link
Contributor

j-xiong commented May 29, 2024

We don't need the brackets ([ and ]) in the commit message title. For example:

core: blah blah

@j-xiong
Copy link
Contributor

j-xiong commented Jun 11, 2024

CLOCK_REALTIME is undefined for Windows. Please add a definition to include/windows/osd.h (right before CLOCK_MONOTONIC). It can be defined as 0 (the value is not used anyway).

Added new interfaces to support pthread_cond_timedwait
which use CLOCK_REALTIME.In general CLOCK_MONOTONIC is
preferred and in use by several providers, therefore new
interfaces are added to support the special case of pthread apis.

[prov/sockets]: changes made to use ofi_get_realtime instead of
ofi_get_time before ofi_wait_cond.

Signed-off-by: Nikhil Nanal <nikhil.nanal@intel.com>
@j-xiong j-xiong merged commit 1a6447a into ofiwg:main Jun 12, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants