polyfoammesh.commercial.cloud_mesh
Collaborative / Cloud meshing — submit mesh jobs to remote clusters.
- Provides:
REST API client for remote meshing service (Slurm / AWS Batch / generic)
Job submission, polling, and result download
Session sharing via share-link export/import
Local job queuing with remote dispatch
Usage:
client = CloudMesher(api_url="https://mesh.example.com/api")
job = client.submit(case_dir="/path/to/case", n_cores=16)
print(f"Job {job.id} submitted, status: {job.status}")
job.wait()
client.download_result(job, output_dir="./results")
Classes
|
Remote/cluster meshing client. |
|
|
|
A remote meshing job. |
|
A shareable link to a meshing session. |
- class polyfoammesh.commercial.cloud_mesh.JobStatus(value)[source]
Bases:
Enum- PENDING = 'pending'
- RUNNING = 'running'
- COMPLETED = 'completed'
- FAILED = 'failed'
- CANCELLED = 'cancelled'
- NOT_SUBMITTED = 'not_submitted'
- class polyfoammesh.commercial.cloud_mesh.MeshJob(id='', status=JobStatus.PENDING, case_dir='', n_cores=1, max_cell=0.05, min_cell=0.01, description='', created_at='', completed_at='', cell_count=0, error='', result_url='')[source]
Bases:
objectA remote meshing job.
- Parameters:
Bases:
objectA shareable link to a meshing session.
- Parameters:
- class polyfoammesh.commercial.cloud_mesh.CloudMesher(api_url='', api_key='')[source]
Bases:
objectRemote/cluster meshing client.
Connects to a REST API endpoint that dispatches mesh jobs to Slurm, PBS, AWS Batch, or a generic worker pool.
Usage:
cm = CloudMesher(api_url="https://mesh.example.com/api") cm.authenticate("api-key-123") job = cm.submit( case_dir="/data/case1", n_cores=8, description="Pipe junction mesh", ) job = cm.poll(job.id) if job.status == JobStatus.COMPLETED: cm.download_result(job, "./results")
- submit(case_dir='', n_cores=1, max_cell=0.05, min_cell=0.01, description='')[source]
Submit a meshing job to the remote service.
If no API URL is configured, creates a local-only job record (offline mode).
- poll(job_id)[source]
Poll a remote job for status update.
Falls back to returning a local status when no API is configured.
- wait(job, poll_interval=5.0, timeout=3600.0)[source]
Block until the job completes, fails, or is cancelled.
Create a shareable link for a meshing session.
Exports the current case configuration as a share link that can be imported by another user.
Export a share link as a JSON string (for clipboard/file).