Skip to content
Snippets Groups Projects
Commit 8ff0e14a authored by Jammer, Tim's avatar Jammer, Tim
Browse files

added free call to default template

parent b86e4017
No related branches found
No related tags found
1 merge request!4Devel tj
#! /usr/bin/python3
from scripts.Infrastructure.MPICallFactory import MPICallFactory
from scripts.Infrastructure.Template import InstructionBlock
from scripts.Infrastructure.AllocCall import AllocCall
from scripts.Infrastructure.AllocCall import AllocCall, get_free
class CorrectParameterFactory:
......@@ -19,6 +19,11 @@ class CorrectParameterFactory:
b.register_operation(AllocCall(self.dtype[0], self.buf_size, self.buf_var_name, use_malloc=False), kind='all')
return b
def get_buffer_free(self):
b = InstructionBlock("free")
b.register_operation(get_free(AllocCall(self.dtype[0], self.buf_size, self.buf_var_name, use_malloc=False)), kind='all')
return b
def get(self, param, func=None):
if param == "BUFFER" or param == "buf" or param == "buffer" or param == "sendbuf" or param == "recvbuf":
return self.buf_var_name
......
......@@ -77,6 +77,8 @@ def get_send_recv_template(send_func, recv_func):
b.register_operation(CorrectMPICallFactory().mpi_wait(), 0)
tm.register_instruction_block(b)
b.register_operation(cf.get_buffer_free())
return tm
......@@ -106,4 +108,6 @@ def get_collective_template(collective_func, seperate=True):
tm.register_instruction_block(b)
b.register_operation(cf.get_buffer_free())
return tm
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment