Hello

The only public portability layer we have for PIDs is hwloc_pid_t when
passed to things like set_proc_cpubind(). But we don't have a portable
getpid() or printf(). You'll have to use getpid() and printf("%ld",
(long)pid) on Unix.

On Windows, hwloc_pid_t is a HANDLE, you don't want to print that. You
can print a process number, and get a HANDLE from a process number using
something like
https://github.com/open-mpi/hwloc/blob/master/utils/hwloc/misc.h#L323

Brice



Le 05/09/2018 à 00:01, Junchao Zhang a écrit :
> Hi,
>   hwloc_set_proc_cpubind() has a pid argument. But how to get the pid
> portably? In addition, I want to convert a pid to an integer and then
> print it out. Does hwloc has APIs to support the needs?
>   Thank you.
> --Junchao Zhang
>
>
> _______________________________________________
> hwloc-users mailing list
> hwloc-users@lists.open-mpi.org
> https://lists.open-mpi.org/mailman/listinfo/hwloc-users

_______________________________________________
hwloc-users mailing list
hwloc-users@lists.open-mpi.org
https://lists.open-mpi.org/mailman/listinfo/hwloc-users

Reply via email to