Lines Matching refs:allocation
106 PetscShmgetAllocation allocation = allocations; in PetscShmgetMapAddresses() local
108 while (allocation) { in PetscShmgetMapAddresses()
109 if (allocation->addr == baseaddres[i]) { in PetscShmgetMapAddresses()
110 bcastinfo.shmkey[i] = allocation->shmkey; in PetscShmgetMapAddresses()
111 bcastinfo.sz[i] = allocation->sz; in PetscShmgetMapAddresses()
115 allocation = allocation->next; in PetscShmgetMapAddresses()
117 …PetscCheck(allocation, comm, PETSC_ERR_PLIB, "Unable to locate PCMPI allocated shared address %p, … in PetscShmgetMapAddresses()
141 PetscShmgetAllocation allocation; in PetscShmgetMapAddresses() local
142 PetscCall(PetscCalloc(sizeof(struct _PetscShmgetAllocation), &allocation)); in PetscShmgetMapAddresses()
143 allocation->shmkey = shmkey; in PetscShmgetMapAddresses()
144 allocation->sz = sz; in PetscShmgetMapAddresses()
145 allocation->shmid = shmget(allocation->shmkey, allocation->sz, 0666); in PetscShmgetMapAddresses()
146 …allocation->shmid != -1, PETSC_COMM_SELF, PETSC_ERR_SYS, "Unable to map PCMPI shared memory key %d… in PetscShmgetMapAddresses()
147 allocation->addr = shmat(allocation->shmid, NULL, 0); in PetscShmgetMapAddresses()
148 …PetscCheck(allocation->addr, PETSC_COMM_SELF, PETSC_ERR_SYS, "Unable to map PCMPI shared memory ke… in PetscShmgetMapAddresses()
149 addres[i] = allocation->addr; in PetscShmgetMapAddresses()
150 if (previous) previous->next = allocation; in PetscShmgetMapAddresses()
151 else allocations = allocation; in PetscShmgetMapAddresses()
279 PetscShmgetAllocation allocation; in PetscShmgetAllocateArray() local
282 PetscCall(PetscCalloc(sizeof(struct _PetscShmgetAllocation), &allocation)); in PetscShmgetAllocateArray()
283 allocation->shmkey = shmkeys++; in PetscShmgetAllocateArray()
284 allocation->sz = sz * asz; in PetscShmgetAllocateArray()
285 allocation->shmid = shmget(allocation->shmkey, allocation->sz, 0666 | IPC_CREAT); in PetscShmgetAllocateArray()
286 …allocation->shmid != -1, PETSC_COMM_SELF, PETSC_ERR_LIB, "Unable to schmget() of size %d with key … in PetscShmgetAllocateArray()
287 allocation->addr = shmat(allocation->shmid, NULL, 0); in PetscShmgetAllocateArray()
288 …PetscCheck(allocation->addr, PETSC_COMM_SELF, PETSC_ERR_LIB, "Unable to shmat() of shmid %d %s", a… in PetscShmgetAllocateArray()
290 …allocation->addr != 0xffffffffffffffff, PETSC_COMM_SELF, PETSC_ERR_LIB, "shmat() of shmid %d retur… in PetscShmgetAllocateArray()
293 if (!allocations) allocations = allocation; in PetscShmgetAllocateArray()
297 next->next = allocation; in PetscShmgetAllocateArray()
299 *addr = allocation->addr; in PetscShmgetAllocateArray()
300 …r array %p shmkey %d shmid %d size %d\n", *addr, allocation->shmkey, allocation->shmid, (int)alloc… in PetscShmgetAllocateArray()