Windows version of pmemkv?

11 views
Skip to first unread message

steve

unread,
Apr 7, 2020, 11:44:16 AM4/7/20
to pmem
Hi all,

Is there a Windows version of pmemkv? If not, is one planned?
Thanks!
------------
Steve Heller

Igor Chorążewicz

unread,
Apr 8, 2020, 4:17:04 AM4/8/20
to st...@steveheller.org, pmem
Hi,

There is no pmemkv version for Windows and currently, there are no plans to change that.
However, if you're interested in concurrent hash map (which is what "cmap" engine in pmemkv uses) you can use it directly from libpmemobj-cpp which does support Windows.

Igor

--
You received this message because you are subscribed to the Google Groups "pmem" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pmem+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pmem/5t7p8flp7k7ecmvvhehph6k4pcescpd4g8%404ax.com.

steve

unread,
Apr 8, 2020, 8:27:42 AM4/8/20
to Igor Chor??ewicz, pmem
Hi Igor,

Thanks, I'll take a look at that. Would there be a simple example program illustrating how to use the concurrent hash map?

On Wed, 8 Apr 2020 10:16:51 +0200, Igor Chor??ewicz <cho...@gmail.com> wrote:

>Hi,
>
>There is no pmemkv version for Windows and currently, there are no plans to
>change that.
>However, if you're interested in concurrent hash map (which is what "cmap"
>engine in pmemkv uses) you can use it directly from libpmemobj-cpp which
>does support Windows.
>
>Igor
>
>wt., 7 kwi 2020 o 17:44 steve <st...@steveheller.org> napisa?(a):
>
>> Hi all,
>>
>> Is there a Windows version of pmemkv? If not, is one planned?
>> Thanks!
>> ------------
>> Steve Heller
------------
Steve Heller

Igor Chorążewicz

unread,
Apr 8, 2020, 8:50:49 AM4/8/20
to st...@steveheller.org, pmem
Please take a look here:  https://pmem.io/libpmemobj-cpp/master/doxygen/classpmem_1_1obj_1_1concurrent__hash__map.html
You can find a code snippet demonstrating a simple usage there. (error handling is a bit verbose but it demonstrates most of the possible exceptions).

Igor

steve

unread,
Apr 8, 2020, 9:03:10 AM4/8/20
to Igor Chor??ewicz, pmem
Hi Igor,

Thanks, I'll give that a try.

On Wed, 8 Apr 2020 14:50:35 +0200, Igor Chor??ewicz <cho...@gmail.com> wrote:

>Please take a look here:
>https://pmem.io/libpmemobj-cpp/master/doxygen/classpmem_1_1obj_1_1concurrent__hash__map.html
>You can find a code snippet demonstrating a simple usage there. (error
>handling is a bit verbose but it demonstrates most of the
>possible exceptions).
>
>Igor
>
>?r., 8 kwi 2020 o 14:27 steve <st...@steveheller.org> napisa?(a):
>
>> Hi Igor,
>>
>> Thanks, I'll take a look at that. Would there be a simple example program
>> illustrating how to use the concurrent hash map?
>>
>> On Wed, 8 Apr 2020 10:16:51 +0200, Igor Chor??ewicz <cho...@gmail.com>
>> wrote:
>>
>> >Hi,
>> >
>> >There is no pmemkv version for Windows and currently, there are no plans
>> to
>> >change that.
>> >However, if you're interested in concurrent hash map (which is what "cmap"
>> >engine in pmemkv uses) you can use it directly from libpmemobj-cpp which
>> >does support Windows.
>> >
>> >Igor
>> >
>> >wt., 7 kwi 2020 o 17:44 steve <st...@steveheller.org> napisa?(a):
>> >
>> >> Hi all,
>> >>
>> >> Is there a Windows version of pmemkv? If not, is one planned?
>> >> Thanks!
>> >> ------------
>> >> Steve Heller
>> ------------
>> Steve Heller
>>
------------
Steve Heller

steve

unread,
Apr 9, 2020, 8:40:14 AM4/9/20
to Igor Chor??ewicz, pmem
On Wed, 8 Apr 2020 14:50:35 +0200, Igor Chor??ewicz <cho...@gmail.com> wrote:

>Please take a look here:
>https://pmem.io/libpmemobj-cpp/master/doxygen/classpmem_1_1obj_1_1concurrent__hash__map.html
>You can find a code snippet demonstrating a simple usage there. (error
>handling is a bit verbose but it demonstrates most of the
>possible exceptions).

I've downloaded and installed everything needed and can compile and link the program successfully.
But when I run it in the VC++ 2019 debugger with the argument "f:\test.map", where f:\ is my Optane PM DAX volume, I get this output:

"Exception occured!
Exception: Pool already closed"

Tracing through it, I see that the line

pop = pool<root>::open(path, "concurrent_hash_map example");

throws the exception.

Can you help me figure out what is going on?

Alternatively, do you know of a sample that allows me to store some records and exit normally, then on a separate run, lets me retrieve those records?
One thread would be fine; I don't care about multithreading.

Thanks!
------------
Steve Heller

Igor Chorążewicz

unread,
Apr 9, 2020, 10:05:59 AM4/9/20
to st...@steveheller.org, pmem
It's actually a problem with the example itself, I've fixed it here:  https://github.com/igchor/libpmemobj-cpp/blob/hash_map_doc_snippet_fix/examples/doc_snippets/concurrent_hash_map.cpp
It should be merged into master soon, but for now you can try to use the example directly from my branch,

Before running the example, you must first create a pool using pmempool utility (as described in a comment in the updated version):
pmempool create obj --layout="concurrent_hash_map" --size 1G path_to_a_pool 

and then pass that path_to_a_pool to the example binary.

Note that it's also possible to create a pool from within the program (by calling pool::create) - we just didn't want to complicate the example's code.

Igor 

steve

unread,
Apr 9, 2020, 10:18:55 AM4/9/20
to Igor Chor??ewicz, pmem
Hi Igor,

This is what happens when I try to build pmempool.vcxproj. Any suggestions?

libpmemcommon
Build started 4/9/2020 9:16:37 AM.
Target _PrepareForClean:
Deleting file "x64\Debug\libpmemcommon.tlog\libpmemcommon.lastbuildstate".
Target ResolveProjectReferences:
Target InitializeBuildStatus:
Touching "x64\Debug\libpmemcommon.tlog\unsuccessfulbuild".
Target VcpkgTripletSelection:
Using triplet "x64-windows" from "D:\vcpkg\installed\x64-windows\"
Target ClCompile:
auto_flush_windows.c
usc_windows.c
D:\PMDK\pmdk-master\src\libpmem2\usc_windows.c(110,34): error C2065: 'PMEM2_E_BUFFER_TOO_SMALL': undeclared identifier
D:\PMDK\pmdk-master\src\libpmem2\usc_windows.c(136,34): error C2065: 'PMEM2_E_BUFFER_TOO_SMALL': undeclared identifier
badblock_none.c
set_badblocks.c
ctl.c
ctl_cow.c
ctl_prefault.c
ctl_sds.c
ctl_fallocate.c
file.c
D:\PMDK\pmdk-master\src\common\file.c(71,29): error C2220: the following warning is treated as an error
D:\PMDK\pmdk-master\src\common\file.c(71,29): warning C4013: 'pmem2_err_to_errno' undefined; assuming extern returning int
D:\PMDK\pmdk-master\src\common\file.c(176,33): warning C4013: 'pmem2_source_from_fd' undefined; assuming extern returning int
D:\PMDK\pmdk-master\src\common\file.c(181,25): warning C4013: 'pmem2_source_size' undefined; assuming extern returning int
D:\PMDK\pmdk-master\src\common\file.c(183,21): warning C4013: 'pmem2_source_delete' undefined; assuming extern returning int
file_windows.c
mmap.c
mmap_windows.c
os_deep_windows.c
pool_hdr.c
rand.c

Build FAILED.


On Thu, 9 Apr 2020 16:05:45 +0200, Igor Chor??ewicz <cho...@gmail.com> wrote:

>It's actually a problem with the example itself, I've fixed it here:
>https://github.com/igchor/libpmemobj-cpp/blob/hash_map_doc_snippet_fix/examples/doc_snippets/concurrent_hash_map.cpp
>It should be merged into master soon, but for now you can try to use the
>example directly from my branch,
>
>Before running the example, you must first create a pool using pmempool
>utility (as described in a comment in the updated version):
>pmempool create obj --layout="concurrent_hash_map" --size 1G path_to_a_pool
>
>and then pass that path_to_a_pool to the example binary.
>
>Note that it's also possible to create a pool from within the program (by
>calling pool::create) - we just didn't want to complicate the example's
>code.
>
>Igor
>
>czw., 9 kwi 2020 o 14:40 steve <st...@steveheller.org> napisa?(a):
>
>> On Wed, 8 Apr 2020 14:50:35 +0200, Igor Chor??ewicz <cho...@gmail.com>
>> wrote:
>>
>> >Please take a look here:
>> >
>> https://pmem.io/libpmemobj-cpp/master/doxygen/classpmem_1_1obj_1_1concurrent__hash__map.html
>> >You can find a code snippet demonstrating a simple usage there. (error
>> >handling is a bit verbose but it demonstrates most of the
>> >possible exceptions).
>>
>> I've downloaded and installed everything needed and can compile and link
>> the program successfully.
>> But when I run it in the VC++ 2019 debugger with the argument
>> "f:\test.map", where f:\ is my Optane PM DAX volume, I get this output:
>>
>> "Exception occured!
>> Exception: Pool already closed"
>>
>> Tracing through it, I see that the line
>>
>> pop = pool<root>::open(path, "concurrent_hash_map example");
>>
>> throws the exception.
>>
>> Can you help me figure out what is going on?
>>
>> Alternatively, do you know of a sample that allows me to store some
>> records and exit normally, then on a separate run, lets me retrieve those
>> records?
>> One thread would be fine; I don't care about multithreading.
>>
>> Thanks!
>> ------------
>> Steve Heller
>>
------------
Steve Heller

Igor Chorążewicz

unread,
Apr 10, 2020, 5:13:01 AM4/10/20
to st...@steveheller.org, pmem
Hi,

I think the fact that you have PMDK installed from vcpkg can be problematic.
We'll try to fix that but for now, could you please try to uninstall PMDK from vcpkg and just build it yourself along with pmempool? 

Igor

--
You received this message because you are subscribed to the Google Groups "pmem" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pmem+uns...@googlegroups.com.

steve

unread,
Apr 10, 2020, 8:21:59 AM4/10/20
to Igor Chor??ewicz, pmem
Hi Igor,

I tried that before without success. I'll try it again and let you know how I do.
Are there easy-to-follow instructions on how to build PMDK?
Thanks!

On Fri, 10 Apr 2020 11:12:47 +0200, Igor Chor??ewicz <cho...@gmail.com> wrote:

>Hi,
>
>I think the fact that you have PMDK installed from vcpkg can be problematic.
>We'll try to fix that but for now, could you please try to uninstall PMDK
>from vcpkg and just build it yourself along with pmempool?
>
>Igor
>
>czw., 9 kwi 2020 o 16:18 steve <st...@steveheller.org> napisa?(a):
------------
Steve Heller

steve

unread,
Apr 10, 2020, 8:23:19 AM4/10/20
to Igor Chor??ewicz, pmem
Hi Igor,

Also instructions on how to uninstall PMDK from vcpkg would be appreciated.

On Fri, 10 Apr 2020 11:12:47 +0200, Igor Chor??ewicz <cho...@gmail.com> wrote:

>Hi,
>
>I think the fact that you have PMDK installed from vcpkg can be problematic.
>We'll try to fix that but for now, could you please try to uninstall PMDK
>from vcpkg and just build it yourself along with pmempool?
>
>Igor
>
>czw., 9 kwi 2020 o 16:18 steve <st...@steveheller.org> napisa?(a):

Igor Chorążewicz

unread,
Apr 10, 2020, 8:35:48 AM4/10/20
to st...@steveheller.org, pmem
I think 'remove' command should work for vcpkg. But before removing, please try to build the whole PMDK solution as described here: https://github.com/pmem/pmdk#building-pmdk-on-windows 
You tried to build only a single project (pmempool) instead of the whole solution - this might be the cause of the problem.

Igor
Reply all
Reply to author
Forward
0 new messages