Resource Proportional Programming for Persistent Memory