code: def build_mmap_chunks(chunks, worker, file_prefix):
      write_mmap_chunks = []
      nrows = sum(c.shape[0] for c in chunks)
      array_shape = (nrows, chunks[0].shape[1])
      array_dtype = chunks[0].dtype
      create_mmap_op = TensorConcatenate(
          mmap=True,
          create_mmap_file=True,
          total_shape=array_shape,
          file_prefix=file_prefix,
          dtype=array_dtype,
      )
      create_mmap_op.expect_worker = worker
      create_mmap_chunk = create_mmap_op.new_chunk(
          None, index=(0,), shape=(), dtype=array_dtype
      )
      start_index = 0
      for j, chk in enumerate(chunks):
          s = slice(start_index, start_index + chk.shape[0])
          start_index += chk.shape[0]
          write_mmap_op = TensorConcatenate(
              mmap=True,
              create_mmap_file=False,
              total_shape=array_shape,
              partition_slice=s,
              dtype=array_dtype,
          )
          write_mmap_op.expect_worker = worker
          write_mmap_chunk = write_mmap_op.new_chunk(
              [create_mmap_chunk, chk],
              index=(j + 1, 0),
              shape=(),
              dtype=array_dtype,
          )
          write_mmap_chunks.append(write_mmap_chunk)
      return write_mmap_chunks
  
file_path: mars/mars/learn/proxima/core.py
imports: import numpy
  from ...None import tensor
  from ...tensor.merge import TensorConcatenate
  from ...tensor.indexing import TensorSlice
label_desc: Use image node_id 2 for calling a global function with example usage: build_mmap_chunks(chunks, worker, file_prefix) and returns: write_mmap_chunks